Three-dimensional road model generation method and device, electronic equipment and storage medium

By acquiring and processing road curves, selecting matching road components for splicing, and generating a 3D road model, the problem of wasted manpower and resources in existing technologies is solved. This achieves automated generation of diverse 3D road models, enhancing the richness of game scenes and the interactive experience.

CN120997378APending Publication Date: 2025-11-21NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510857349.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies require significant manpower and time for manual placement when generating 3D road models, while procedural generation methods produce models with simple shapes that are difficult to modify, resulting in wasted resources, monotonous gameplay, and excessive device storage space.

Method used

By acquiring road curves, determining curve types, processing curve segments of three-dimensional road types based on preset rules, selecting matching road components for splicing, and generating a three-dimensional road model.

Benefits of technology

It enables the automated generation of diverse 3D road models, reducing labor costs, enhancing the interactive experience, enriching the expressiveness of game scenes, and solving the problems of low generation efficiency and insufficient model accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997378A_ABST
    Figure CN120997378A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional road model generation method and device, electronic equipment and a storage medium. The method comprises the steps that a road curve is acquired; for each curve segment, determining the curve type of the curve segment; if the curve segments are of a three-dimensional road type, processing the curve segments based on a preset processing rule, and generating a processed road curve; selecting a road component matched with the curve segment from a preset component library according to the attribute information corresponding to the curve segment; and according to the processed road curve, splicing the road components matched with the curve segments to obtain a three-dimensional space road model. According to the method provided by the invention, the complex and natural three-dimensional road structure can be automatically generated based on the characteristics of the road curve and the curve segmentation thereof.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of gaming, and in particular to a method, apparatus, electronic device, and storage medium for generating three-dimensional road models. Background Technology

[0002] Scene construction in game development often requires the design of complex and diverse road systems, especially in open-world games. Three-dimensional roads allow players to freely traverse and explore multi-layered environments, enhancing the gaming experience. Related technologies for generating three-dimensional road models typically fall into two categories: one involves manually placing the required models within the game scene through art scene editing, requiring manual editing to achieve model placement while modifying the terrain height and materials; the other uses procedural generation of road curves, drawing specific road curves and configuring corresponding curve attributes to generate simple road models. However, these solutions have significant shortcomings in practical applications: while manual placement can achieve good game scene effects, it requires substantial manpower and time for large projects, and resource updates may necessitate redoing previous work; while procedural generation, although efficient, often produces road models with highly customized and relatively simple cross-sectional shapes, making it difficult to handle complex modeling needs. Modifying shapes requires developer intervention, resulting in cumbersome user operations, monotonous gameplay, and increased consumption of device storage space and server resources. Summary of the Invention

[0003] The purpose of this disclosure is to provide a method, apparatus, electronic device, and storage medium for generating three-dimensional road models, so as to achieve the automated generation of diverse three-dimensional road models and the effect of seamless connection.

[0004] Firstly, this disclosure provides a method for generating a three-dimensional road model, comprising: acquiring a road curve, the road curve comprising multiple curve segments; for each curve segment, determining the curve type of the curve segment, the curve type including planar road type and three-dimensional road type; if the curve segment is a three-dimensional road type, processing the curve segment based on preset processing rules to generate a processed road curve; selecting a road component matching the curve segment from a preset component library according to the attribute information corresponding to the curve segment; and splicing the road components matching each curve segment according to the processed road curve to obtain a three-dimensional road model.

[0005] Secondly, this disclosure provides a device for generating a three-dimensional road model, comprising: an acquisition module for acquiring road curves, the road curves including multiple curve segments; a determination module for determining the curve type of each curve segment, the curve type including planar road type and three-dimensional road type; a processing module for processing the curve segment based on preset processing rules if the curve segment is a three-dimensional road type, to generate a processed road curve; a selection module for selecting road components matching the curve segment from a preset component library according to the attribute information corresponding to the curve segment; and a generation module for splicing the road components matching each curve segment according to the processed road curve to obtain a three-dimensional road model.

[0006] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to perform the steps in the method for generating a three-dimensional spatial road model as described in any of the preceding claims.

[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the steps in the method for generating a three-dimensional spatial road model as described above.

[0008] This disclosure provides a method, apparatus, electronic device, and storage medium for generating a three-dimensional road model. The method involves acquiring road curves, each comprising multiple curve segments; determining the curve type for each curve segment, including planar road and three-dimensional road types; if the curve segment is a three-dimensional road type, processing it based on preset processing rules to generate a processed road curve; selecting road components matching the curve segment from a preset component library based on the attribute information corresponding to the curve segment; and stitching together the matching road components for each curve segment according to the processed road curve to obtain a three-dimensional spatial road model. The method provided by this disclosure allows users to quickly generate complex three-dimensional spatial road models through simple curve editing and attribute settings; it also supports flexible combinations of various road types and components, enriching the expressiveness of game scenes. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0010] Figure 1 This is a cloud interaction system architecture diagram according to an exemplary embodiment of the present disclosure; Figure 2 A schematic flowchart illustrating a method for generating a three-dimensional road model according to an embodiment of this disclosure; Figure 3 A schematic diagram of the structure of a device for generating a three-dimensional road model provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0011] The technical solutions of this disclosure will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0012] It should be noted that the information (including but not limited to user input information, such as information entered by the user into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, the service pressure corresponding to operations performed on all code of the current project, and the code development status of the current project), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and the code development status involved in this application were all obtained with full authorization.

[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] It should also be noted that the various trigger events disclosed in this manual can be preset, and different trigger events can trigger the execution of different functions.

[0015] A method for generating a three-dimensional road model in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device. When the method for generating the three-dimensional road model runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices. Figure 1 The figure shows a cloud interaction system architecture diagram provided in this disclosure. As shown, the cloud interaction system may include: a client device 10 and a server 20, wherein the client device 10 can be connected to the server 20 via a network 30.

[0016] The method for generating a three-dimensional road model in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device, such as a touch device or a non-touch device. When the method for generating the three-dimensional road model runs on a server, the method can be implemented and executed based on a cloud interaction system, which includes a server and client devices.

[0017] In an optional implementation, cloud gaming can run within the cloud interaction system. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operation mode, the game program and the game screen presentation are separated. The storage and execution of the 3D road model generation method are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game interface and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game interface.

[0018] In an optional implementation, the terminal device can be a local terminal device that stores the game program and is used to present the game interface. The local terminal device is used to interact with the player through the game interface; that is, it typically downloads, installs, and runs the game program via an electronic device. The local terminal device can provide the game interface to the player in various ways, such as rendering it on a terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen and a processor. The display screen is used to present the game interface, which includes game scene visuals, and the processor is used to run the game, generate the game interface, and control the display of the game interface on the display screen.

[0019] This embodiment provides a method for generating a three-dimensional road model. Figure 2 This is a flowchart of a method for generating a three-dimensional road model according to an embodiment of the present disclosure, such as... Figure 1 As shown, the process includes the following steps: Step S210: Obtain the road curve, which includes multiple curve segments; Step S220: For each curve segment, determine the curve type of the curve segment. The curve type includes level road type and grade-separated road type. Step S230: If the curve segment is a three-dimensional road type, process the curve segment based on the preset processing rules to generate the processed road curve. Step S240: Select a road component that matches the curve segment from the preset component library based on the attribute information corresponding to the curve segment; Step S250: Based on the processed road curves, the road components that match the curve segments are spliced ​​together to obtain a three-dimensional road model.

[0020] The method provided in this embodiment enables the automatic generation of 3D road models based on the characteristics of road curves and their segments. This not only reduces manual editing costs but also enhances the interactive experience, allowing users to more easily create complex 3D road structures. Furthermore, through intelligent processing of different types of curve segments and component matching technology, the richness of the game is increased, providing more possibilities for game scene construction. In addition, this method solves computer science problems in traditional 3D road model generation, including low efficiency in building large scenes and unnatural splicing of 3D roads.

[0021] The steps described above are explained in detail below.

[0022] In step S210, a road curve is obtained. The road curve includes multiple curve segments. When applying it, the road curve can be drawn using a graphic design tool or a road editor, and the overall road curve can be divided into multiple curve segments.

[0023] Specifically, the process of acquiring road curves can be performed through a user interface. Users can define the road's direction in computer-aided design software, and the system will record the geometric shape and spatial location information of the road curves. Based on the acquired road curves, the system will automatically or manually divide the continuous road curves into multiple curve segments, each of which may have different attribute characteristics.

[0024] In this context, a road curve can be a geometric object representing a road's spatial path. A road curve typically contains a series of control points and curve segments connecting these control points, used to define the road's path and shape.

[0025] In an optional implementation, curve segmentation can be automatically based on points of change in road attributes, such as changes in road width, changes in road height, or locations where the turning angle reaches a threshold. The system will automatically segment at these points of change, ensuring that the road characteristics within each segment are relatively consistent, facilitating subsequent processing.

[0026] In an alternative implementation, each curve segment may contain its own attribute data, such as segment length, curvature, coordinates of the start and end points, width parameters, etc. This attribute data may be stored in the metadata of the curve segment to provide necessary information for subsequent processing.

[0027] In step S220, for each curve segment, the curve type of the curve segment is determined. The curve type includes level road type and grade-separated road type.

[0028] The curve type in curve segmentation can be a classification identifier describing the spatial characteristics of a road. It mainly divides roads into two types: surface roads (ordinary roads on the ground) and grade-separated roads (such as elevated roads, tunnels, and other roads with changes in spatial height).

[0029] Secondly, the curve type often guides the selection of subsequent processing procedures. Different types of roads require different processing rules and component matching strategies to achieve model generation suitable for their spatial characteristics.

[0030] In an optional implementation, the type of a curve segment can be determined based on the rate of change of the curve's height in the vertical direction. When the rate of change exceeds a preset threshold, the system classifies it as a grade-separated road; when the height change is small or nonexistent, it is classified as a planar road. Users can select specific curve segments by clicking and manually set or modify their road type through interface controls. For example, a user can click on a curve segment and then select to mark it as a "grade-separated road" in the properties panel.

[0031] In an optional implementation, the curve type can also be determined based on the intersection of the curve with the terrain. If the curve passes through the terrain in space or is significantly higher than the terrain, the system will determine it as a three-dimensional road type; if the curve is basically close to the terrain surface, it will be determined as a two-dimensional road type.

[0032] In an optional implementation, users can also specify the type of curve segments directly on the graphical interface using preset marking tools, such as using different colors or labels to distinguish between planar roads and different types of three-dimensional roads. The system will record these manually set type information for subsequent processing.

[0033] In step S230, if the curve segment is a three-dimensional road type, the curve segment is processed based on preset processing rules to generate the processed road curve.

[0034] Specifically, for curve segments identified as three-dimensional road types, the system applies specially designed processing rules to perform geometric adjustments, spatial position optimizations, and connection point corrections on these curves to ensure that the generated three-dimensional road model meets physical and aesthetic requirements.

[0035] The preset processing rules can be a set of algorithms and parameters designed specifically for the characteristics of three-dimensional roads. These rules define how to modify and optimize the curves of three-dimensional roads to meet the geometric requirements for generating high-quality road models.

[0036] Secondly, the pre-defined processing rules are typically designed to solve the unique geometric problems of grade-separated roads. For example, they can address complex geometric relationships such as the support issues of elevated roads, the smooth transition at tunnel entrances, and the connection between ramps and main roads.

[0037] In step S240, a road component matching the curve segment is selected from the preset component library based on the attribute information corresponding to the curve segment.

[0038] Specifically, the attribute information mentioned here may refer to the road identifier carried by the curve segment, which is used to characterize what type of road component the curve segment needs to use.

[0039] Specifically, the system can also analyze the specific attributes of each curve segment, such as width, type, and slope, and select the road component that best matches the characteristics of the current curve segment from a pre-established component library. This process takes into account the geometric characteristics, functional attributes, and compatibility with adjacent components of the component.

[0040] The preset component library can be a collection of resources containing various road model fragments. These components are categorized and stored according to different road types, widths, angles, and other parameters, making it easy for the system to quickly find and call them.

[0041] Secondly, pre-built component libraries typically serve to provide reusable model resources. They store high-quality pre-made model fragments that can be selected and combined as needed to form complete road models.

[0042] In an optional implementation, the component selection process can be based on a multi-dimensional matching algorithm. The system comprehensively considers multiple parameters such as the width, height, curvature, and type of the curve segment, calculates the matching score with each component in the library, and selects the component with the highest matching score. Users can view candidate components and manually override the system's selection by clicking. For example, a user can click on a specific curve segment to view a list of recommended components and then click on different components to replace it.

[0043] In an alternative implementation, if there is no perfect match in the library, the system will select the closest component and calculate the required deformation parameters to prepare for subsequent component deformation and adjustment, ensuring that even if there is no perfectly matching prefabricated component, a road section that meets the requirements can be obtained through reasonable deformation.

[0044] In step S250, the road components that match the segments of each curve are spliced ​​together according to the processed road curves to obtain a three-dimensional road model.

[0045] Specifically, the system will position, rotate, and deform the road components selected for each curve segment in the previous steps according to their spatial relationships along the processed road curve, and then stitch them together to form a continuous 3D road model. During the stitching process, the system will handle the seams between components to ensure the continuity and visual consistency of the model.

[0046] The splicing process can be a technical operation that combines multiple independent road components into a continuous whole. It involves multiple steps such as spatial positioning of components, rotational alignment, deformation adjustment, and joint treatment.

[0047] Secondly, the stitching process typically serves to create a visually continuous and functionally complete road model. Precise stitching ensures that vehicles can travel smoothly on the generated road without unreasonable jumps or breaks.

[0048] In an alternative implementation, particularly at component junctions, the system applies mesh fusion technology to analyze the mesh structure of two adjacent components, identify overlapping or close edge vertices, and use operations such as vertex merging and normal smoothing to make the geometry and texture at the joint transition naturally, avoiding visible breaks or overlaps.

[0049] In a method for generating a three-dimensional road model according to an embodiment of this application, if the curve segment is a three-dimensional road type, the curve segment is processed based on preset processing rules to generate a processed road curve, including: Step S2301: If the curve segment is a grade-separated road type, determine the grade-separated road subtype to which the curve segment belongs; Step S2302: Process the curve segments based on the specified processing rules corresponding to the three-dimensional road subtype to generate the processed road curve.

[0050] The method provided in this embodiment enables the system to adopt corresponding processing rules according to different subtypes of three-dimensional roads, and to process various types of three-dimensional road curve segments in a targeted manner, thereby generating more accurate and realistic three-dimensional road models that meet actual needs. This also enhances the richness and realism of the game scene, and solves the problem of insufficient accuracy and adaptability in the generation of three-dimensional road models in the computer field.

[0051] The above plan will be explained in detail below.

[0052] In step S2301, if the curve segment is a three-dimensional road type, the three-dimensional road subtype to which the curve segment belongs is determined.

[0053] Specifically, the system first confirms the identification information of the curve segment in order to determine the specific type to which the curve segment belongs.

[0054] Among these, the subtype of an elevated road can serve as a classification identifier reflecting the specific structural category and characteristics of curve segments in three-dimensional space. Secondly, the subtype of an elevated road typically guides the system in selecting appropriate processing rules to implement differentiated treatment for road curves with different spatial structural characteristics.

[0055] In an optional implementation, the subtype of an elevated road can be determined by specific attribute markers on the curve segment. These markers can be predefined strings or numerical codes used to accurately identify the road subtype within the system. For example, the system can set a "roadSubType" attribute in the segment attributes of the road curve, with values ​​such as "elevated," "tunnel," "ramp," or "interchange." After reading this attribute value, the system can determine the subtype of the elevated road segment.

[0056] In an optional implementation, the determination of the subtype of an elevated road can also be automatically inferred by combining the geometric features of the curve segments, such as by comprehensively judging parameters such as the height change, curvature characteristics, and spatial relationship with other road curves. For example, when the system detects that the height value of a road curve is significantly higher than the terrain surface and maintains a certain height, it can be automatically identified as an elevated type; when the system detects that the curve crosses the terrain and has obvious entrance and exit points, it can be identified as a tunnel type.

[0057] In an alternative implementation, the subtype of a three-dimensional road can also be determined through interactive annotation by the user on a visual interface, allowing art designers to manually specify the subtype of each curve segment according to scene requirements. For example, in the interface of the road design tool, the user can select a specific curve segment and then mark it as the required three-dimensional road subtype through a drop-down menu or shortcut button. The system will save this mark to the curve's attribute data.

[0058] In step S2302, the curve segments are processed based on the specified processing rules corresponding to the three-dimensional road subtype to generate the processed road curve.

[0059] Specifically, based on the determined subtype of the three-dimensional road, the system selects the corresponding rule set from the preset processing rule library, and then performs a series of processing operations on the curve segments according to the rule requirements, including possible geometric transformations, point attribute modifications, curve extensions or smoothing, etc., and finally generates a processed road curve suitable for subsequent road model generation.

[0060] The specified processing rules can be algorithms and parameter sets used to process curves for specific subtypes of 3D roads. Secondly, the specified processing rules typically serve to adjust and optimize the geometry and properties of the curves to ensure that the generated road model conforms to the characteristics of real road engineering and the requirements of the game scenario.

[0061] In an alternative implementation, the specified processing rules may include curve smoothing, which reduces abrupt changes in the curve through interpolation algorithms, making the road path more natural and smooth.

[0062] In an alternative implementation, the specified processing rules may also include adjusting the height of the curve according to terrain features, such as requiring elevated roads to maintain sufficient ground clearance and tunnels to ensure that the curve is below the terrain surface.

[0063] In an alternative implementation, the specified processing rules may also include special processing at road junctions, such as a gradual transition at the junction of a ramp and the main road, and a smooth straightening at the tunnel entrance.

[0064] In a specific application, for road curve segments previously identified as elevated, the system applied specified processing rules for elevated roads: First, it calculated the height difference between each point on the curve and the corresponding terrain, marking points with a height difference greater than 3 meters as "suspended segments" requiring bridge pier support; then, it resampled the curve to ensure that the points were evenly and densely distributed to support detailed model generation; finally, it slightly smoothed the curve to eliminate sharp corners that could cause unnatural bends in the road model. After these processing steps, the original elevated road curve was transformed into a processed road curve carrying more information and with a geometry more suitable for model generation.

[0065] In one embodiment of this application, a method for generating a three-dimensional road model is provided, and the three-dimensional road subtypes include at least one of the following: elevated type, tunnel type, ramp type, and interchange type.

[0066] The method provided in this embodiment enables the system to adopt corresponding processing rules according to the characteristics of different three-dimensional road subtypes, and to process the curve segments of various three-dimensional roads in a targeted manner, thereby improving the accuracy and efficiency of generating three-dimensional road models, making the three-dimensional road models more in line with actual needs, improving the interactive experience, and enhancing the three-dimensionality and realism of the game scene.

[0067] Specifically, the grade-separated road subtype is a further subdivision of the grade-separated road type, so that different processing rules can be adopted for different types of grade-separated roads.

[0068] Among them, the three-dimensional road subtype can be a specific structural type of road curve segments presented in three-dimensional space, used to distinguish three-dimensional road structures with different functions and forms.

[0069] Secondly, the subtype of three-dimensional road usually serves to guide the system in selecting appropriate processing rules and road components, thereby generating a road model that conforms to specific three-dimensional structural characteristics.

[0070] In one alternative implementation, the elevated type represents a road structure where the road curve segment is vertically above the ground at a certain height. It is commonly used in scenarios where the road traverses cities, crosses rivers, or encounters terrain obstacles. For example, in an urban scene, when it is necessary to represent a highway that traverses the city, the corresponding road curve segment can be marked as an elevated type. The system will then generate a road model with piers and a bridge deck structure based on the characteristics of the elevated type, enabling the road to cross the urban roads or terrain below.

[0071] In one alternative implementation, a tunnel type represents a closed road structure where road curves pass through mountains, underground, or other obstacles, consisting of three parts: an entrance, a tunnel body, and an exit. For example, in a mountainous scene, when a road needs to pass through a mountain range, the corresponding road curve segments can be marked as tunnel types. The system will generate tunnel entrance and exit structures on the mountain surface and the tunnel body structure inside the mountain, while automatically handling the lighting effects inside the tunnel to allow players to pass through the area smoothly.

[0072] In an alternative implementation, a ramp type represents a transitional road structure connecting roads at different heights or in different directions, typically appearing as a curved road with a certain slope. For example, in a highway interchange scenario, when a transition from a main road to an auxiliary road is required, the curved segment connecting the two roads can be marked as a ramp type. The system will then generate a ramp structure with an appropriate slope and guardrails to ensure that vehicles can smoothly diverge from the highway to the ground-level road, or merge from the ground-level road back into the highway.

[0073] In one optional implementation, an interchange type represents a complex road structure where multiple roads intersect at different heights, encompassing multi-layered road connection methods. For example, in a complex urban traffic hub scenario, when multiple highways and arterial roads intersect, the road curves in the intersection area can be segmented and marked as interchange types. The system will automatically generate interchange structures based on the number, angle, and height difference of the intersecting roads, including main bridges, auxiliary bridges, and connecting ramps, enabling traffic flow from different directions to pass efficiently and smoothly, enhancing the realism and complexity of the game scenario.

[0074] In a method for generating a three-dimensional road model according to an embodiment of this application, if the curve segment is of the elevated type, the specified processing rules include: The height value of a specified point on the curve segment is compared with the height value of the corresponding terrain. When the specified point is higher than the height value of the corresponding terrain, the curve segment is marked as a suspended segment; when the specified point is lower than the height value of the corresponding terrain, the curve segment is marked as a leveled segment.

[0075] The method provided in this embodiment enables the system to intelligently determine the processing method of the road model based on the relationship between the height of the curve segments and the terrain, achieving a reasonable integration of the road model and the terrain and improving the interactive experience. At the same time, it automatically marks suspended segments and cut-out segments based on height differences, making the road model generation more in line with real-world logic and enriching the three-dimensionality and realism of the game scene. In addition, the automatic judgment and marking processing through algorithms reduces manual intervention and solves the automation problem of large-scale three-dimensional road model generation in the computer field.

[0076] Specifically, after determining that the curve segment is an elevated type, the system needs to determine the spatial relationship between the elevated curve segment and the terrain. By comparing the difference between the specified point on the curve segment and the corresponding terrain height value, it can determine whether the segment is suspended above the terrain or whether the terrain needs to be leveled.

[0077] The designated point can be a set of points uniformly sampled on the curve segment, used to accurately describe the position information of the curve segment in three-dimensional space. The designated point is a specific location on the curve segment selected for comparison with terrain height.

[0078] Secondly, designated points usually serve to determine the spatial relationship between curve segments and terrain. By comparing the height of these points with the terrain height, the system can accurately determine the processing method of the road model.

[0079] In an optional implementation, the designated points can be a set of points obtained by uniformly sampling along the curve segment at preset intervals, for example, sampling one point every 5 meters. This sampling method can ensure a sufficient description of the positional characteristics of the elevated curve segment, improving processing accuracy.

[0080] In an alternative implementation, the designated points can also be a set of points obtained by dynamically adjusting the sampling interval according to the geometric characteristics of the curve segments, with denser sampling in areas of greater curvature and relatively sparser sampling in straight line segments.

[0081] In an optional implementation, the designated point may also include feature points of the curve segment, such as the start point, end point, inflection point, and intersection point with other curves. These feature points play a key role in determining the spatial properties of the curve segment.

[0082] The corresponding terrain height value can be the terrain surface height corresponding to the horizontal projection position of the specified point, obtained from a terrain height map. The corresponding terrain height value refers to the elevation data of the terrain surface below the horizontal position of the specified point.

[0083] Secondly, the corresponding terrain height value usually serves as a benchmark reference. The system determines whether the road should be suspended above the terrain or whether the terrain needs to be leveled by comparing the height of a specified point with this value.

[0084] In this context, "suspended sections" can refer to road segments that require additional support structures, such as bridge piers. These sections are located at a certain height above the terrain and require special treatment to ensure visual plausibility. Suspended sections are the parts of curved road segments that are higher than the corresponding terrain level and require additional support structures.

[0085] In an alternative implementation, the suspended segments can be further categorized based on their height difference from the terrain. For example, when the height difference exceeds a certain threshold (e.g., 10 meters), taller piers or multi-layered pier structures need to be generated. For instance, during the generation of a viaduct model spanning a valley, the system detects that some segments have a height difference of 25 meters from the terrain. Therefore, three-layered pier structures are generated at these locations, while only single-layered piers are generated in areas with smaller height differences, making the final model more consistent with engineering principles.

[0086] Among them, the cut-down section can be a road segment that requires terrain modification, indicating that the road section is located within the original terrain and needs to be excavated to ensure road continuity. The cut-down section refers to the part of a curve segment that is below the terrain surface and needs to be lowered to adapt to the road.

[0087] Secondly, the leveled sections usually serve as indicators of the terrain height that needs to be modified, ensuring that the final generated road model can be seamlessly integrated with the terrain and avoiding the road and terrain from intersecting with each other.

[0088] In a method for generating a three-dimensional road model according to an embodiment of this application, if the curve segment is of ramp type, the specified processing rules include: For the junction of ramp-type curve segments and elevated-type curve segments, the slope of the elevated-type curve segment at the junction is calculated, and offset compensation is performed on the ramp-type curve segment based on the slope.

[0089] The method provided in this embodiment enables seamless connection between ramp-type curve segments and elevated-type curve segments, thereby improving the visual continuity and realism of the road model. By calculating and compensating for the slope of elevated-type curve segments at the connection points, the problem of height differences at the intersections of different road types is solved, enhancing the accuracy and aesthetics of the model, providing users with a smoother road model, and improving the interactive experience.

[0090] Specifically, when a road curve includes ramp-type curve segments, special handling is required at the junctions between the ramps and elevated roads. First, the system detects the intersection points of the ramp-type and elevated-type curve segments, identifying these points as junctions. Then, the system analyzes the slope changes of the elevated-type curve segments at the junctions and calculates the specific slope value. Based on the calculated slope value, the system applies appropriate offset compensation to the starting portion of the ramp-type curve segments to ensure a seamless connection between the two road types.

[0091] Among them, ramp-type curve segments can serve as transitional road sections connecting different road levels. Ramp-type curve segments typically have the characteristic of smoothly transitioning from one level to another, and are a key component in realizing the connection between roads at different levels in an elevated road system.

[0092] In an alternative implementation, the curve segmentation of a ramp type may include acceleration ramps and deceleration ramps, classified according to the type and function of the elevated road they connect to. For example, when a ramp is used to connect the main line of a highway with an auxiliary road, the ramp can be divided into entrance ramps and exit ramps according to the direction of vehicle travel, and different slope calculation and offset compensation strategies can be applied to each.

[0093] The slope of elevated curve segments can be defined as the degree of inclination of the curve in the vertical direction in three-dimensional space. The slope of elevated curve segments is commonly used to represent the rate of change of elevated roads in the vertical direction and is a fundamental parameter for calculating ramp offset compensation.

[0094] In an alternative implementation, the slope of elevated curve segments can be calculated by analyzing the ratio of the height difference to the horizontal distance between adjacent control points in space, thus obtaining an accurate slope value. For example, when designing urban elevated bridges, the system calculates the slope percentage based on the height change and horizontal distance between two adjacent points, and uses this as a basis for the design of ramp connections.

[0095] In one alternative implementation, the slope of elevated curve segments can be divided into ascending and descending slopes. The offset compensation strategy for ramps will also differ depending on the slope direction. For example, when the elevated road is on an ascending slope, the connecting ramps need to be offset upwards to ensure a smooth transition; while when the elevated road is on a descending slope, it needs to be offset downwards.

[0096] Offset compensation can be used to adjust the spatial position of ramp curves based on the slope of the elevated road. Offset compensation typically ensures the accurate connection between ramps and elevated roads in three-dimensional space and is a key technical means to guarantee the visual continuity of the generated 3D road model.

[0097] In an alternative implementation, offset compensation can be achieved through vector calculation, that is, calculating the required vertical displacement of the starting segment of the ramp based on the normal vector and slope value of the elevated road. For example, in an interchange, if the slope of the elevated road at the junction is 5%, the system will calculate the required upward offset of the starting point of the ramp to ensure precise spatial alignment between the two.

[0098] In an alternative implementation, offset compensation can employ a gradient transition approach, whereby the compensation amount is gradually reduced along the ramp curve, starting from the connection point, until the ramp fully transitions to the target height. For example, in an urban expressway interchange system, after the ramp separates from the elevated road, the compensation amount gradually decreases from its maximum value to zero, ensuring a smooth change in road height.

[0099] In an alternative implementation, offset compensation can also take into account changes in the road cross-section, applying different compensation amounts to different lateral positions of the ramp to handle situations such as changes in superelevation. For example, when a curved ramp connects to an elevated road, the compensation amounts on the inner and outer sides will differ to accommodate changes in the road's lateral slope.

[0100] In a method for generating a three-dimensional road model provided in one embodiment of this application, if the curve segment is of the tunnel type, the specified processing rules include: extending a predetermined distance at both ends of the curve segment of the tunnel type and performing smooth straightening processing.

[0101] The method provided in this embodiment ensures a smooth transition between tunnel entrance and exit areas by extending and straightening curve segments at both ends, thereby improving the connection between tunnels and other road types and enhancing the visual continuity and realism of the overall road model. This approach effectively solves the abruptness problem often found at the junction of tunnels and external roads in traditional road modeling, while reducing the computational resource consumption of manual modeling through automated algorithm processing.

[0102] Specifically, when a curve segment is determined to be a tunnel type, the system will perform special processing on the curve segment according to preset processing rules to meet the special requirements of generating tunnel type road models. These processing rules mainly include two operations: first, extending the tunnel type curve segment by a predetermined distance at both ends; and second, performing smoothing and straightening processing on the extended curve segment to form a road curve suitable for generating tunnel entrance and exit models.

[0103] The predetermined distance can be an extension length value set according to the curve segmentation of the tunnel type. The predetermined distance refers to a fixed length extending outward from the start and end points of the tunnel curve segment, which is usually dynamically calculated based on parameters such as the width and height of the tunnel.

[0104] Secondly, the predetermined distance usually serves to ensure that there is sufficient transition space between the tunnel entrance and exit areas, so that the tunnel model can be smoothly connected to the external road model.

[0105] Among them, smoothing and straightening can be a curvature reduction process performed on the extended curve segment. Smoothing and straightening refers to a mathematical processing method that gradually reduces the curvature of the curve through an algorithm, making the curve tend to be a straight line.

[0106] Secondly, smoothing and straightening processes typically ensure that roads in tunnel entrance and exit areas are straight, reducing sharp turns and improving driving safety and model aesthetics.

[0107] In a method for generating a three-dimensional road model provided in one embodiment of this application, the segmented curve carries a road type identifier, which is used to characterize the type of road component required by the segmented curve.

[0108] The method provided in this embodiment enables the system to accurately select and match appropriate road components based on road type identifiers, improving the accuracy and efficiency of road model generation. This identifier mechanism effectively associates curve information with specific component types, enhancing the interactive experience during model generation. Simultaneously, it enriches the possibilities of road modeling through type-based management, solving the problem of wasted computational resources caused by inaccurate component selection in traditional methods.

[0109] The road type identifier can be a type attribute value for road segments, used to classify curve segments and guide the component selection process. This identifier is typically recorded in the attribute data structure of the curve segment and can be read and parsed by the system.

[0110] Secondly, road type identification usually serves to guide the system to accurately select matching road components from a preset component library, ensuring that the generated road model meets the design intent and visual requirements.

[0111] In an optional implementation, the road type identifier can be in the form of a string, directly corresponding to the road component category name in the component library, such as "elevated road", "tunnel entrance", "ramp connection section", etc. The system selects the corresponding component through a string matching mechanism.

[0112] In an alternative implementation, the road type identifier may also include a dynamic parameter section for fine-tuning the characteristics of the selected component, such as "tunnel_[-4.5]", where the value in square brackets represents the tunnel depth offset, which the system applies to adjust after selecting the basic tunnel component.

[0113] In one embodiment of this application, a method for generating a three-dimensional road model is provided, which further includes: For road curves, a three-layer curve attribute system is established, including a control point layer, a segment layer, and an overall layer. The control point layer is used to set the properties of point position, point normal, and tangent; the segment layer is used to set the properties of curve segment width, height, and road component type; and the global layer is used to set global properties applicable to the entire road.

[0114] The method provided in this embodiment enables precise organization and management of road curve attribute information at different levels, improving the rationality of the data structure and operational flexibility in the road model generation process, thereby enhancing the interactive experience of the system. Simultaneously, the three-layer structure design allows road attributes to be edited and controlled at different granularities, increasing the richness of game scene design and effectively solving the data organization and management problems of complex road systems in large open-world games.

[0115] Specifically, the control point layer, as the most basic layer in the three-layer curve attribute system, is mainly responsible for managing the geometric attributes of each control point on the road curve, providing the most basic shape definition and direction control for the road curve. By setting the position coordinates, normal direction, and tangent direction of each point in the control point layer, the geometric characteristics of the road, such as path direction, slope changes, and turning curvature, can be precisely controlled.

[0116] The segmentation layer is used to set the width, height, and road component type attributes of the curve segments.

[0117] Specifically, the segment layer, as the middle layer of the three-layer curve attribute system, is responsible for managing the specific attributes of each segment of the road curve, such as width parameters, height parameters, and the matching road component type information. By setting these attributes in the segment layer, different parts of the same road curve can exhibit different road characteristics, such as variations in width, height differences, and component type switching, thereby achieving diversification and complexity of road morphology.

[0118] The overall layer is used to set global attributes applicable to the entire road.

[0119] Specifically, the global layer, as the highest layer of the three-layer curve attribute system, is responsible for managing global attribute settings applicable to the entire road. These global attributes affect the overall appearance and generation rules of the road. By setting global parameters at the global layer, it is possible to ensure consistency and coherence in the overall style, material properties, and functional positioning of the road model.

[0120] The overall layer provides a unified global attribute control mechanism for the entire road. The overall layer typically ensures the overall consistency and systematic nature of the road model.

[0121] In an alternative implementation, the overall layer may include global settings related to road material and texture, such as road surface material type, wear level, texture details, etc., to ensure that the entire road has a visually consistent material appearance.

[0122] In one embodiment of this application, a method for generating a three-dimensional road model is provided, which further includes: Provides a visual interface for editing the three-layer structure curve property system; and Export the data of the three-layer structure curve attribute system using a preset format.

[0123] The method provided in this embodiment allows users to intuitively edit the attributes of each layer of road curves through a visual interface and export data in a standardized format, facilitating the efficient use of these attribute data during the generation of 3D road models. This approach enhances the interactive experience, enabling users to edit road attributes more efficiently through an intuitive visual interface; it supports the generation of more diverse road models through detailed attribute settings; and it solves the problem of managing complex attribute data in the computer field, achieving efficient data storage and utilization.

[0124] Specifically, providing a visual interface for editing the three-layer structure curve attribute system means enabling users to intuitively view, create, and modify the attribute data of each layer of the road curve through a graphical user interface.

[0125] Among these features, a visual interface provides a graphical user interaction environment, enabling users to visually edit various parameters in the curve attribute system. Furthermore, visual interfaces typically simplify the editing process of complex data, improving the efficiency of users in editing the curve attribute system.

[0126] Specifically, exporting data from a three-layer curve attribute system using a preset format means saving the curve attribute data edited by the user in the visual interface to the file system in a standardized format, so that subsequent processing programs can read and use this data.

[0127] The preset format can be a standardized data structure and file format used for storing and transmitting curve attribute data. Secondly, the preset format typically ensures data integrity and compatibility, facilitating the transfer and parsing of curve attribute information between different system components.

[0128] In an optional implementation, the default format adopts a JSON (JavaScript Object Notation) structure, which organizes the three-level attribute data into hierarchically nested objects. The top-level object contains the overall layer attributes, the lower layer contains the segment layer attribute list, and each segment object contains the attribute data of the control points on that segment.

[0129] In a method for generating a three-dimensional road model according to an embodiment of this application, before selecting a road component that matches the curve segment from a preset component library, the method further includes: Road components are classified according to road function, model angle type, and lane width; Assign a unique identifier to each road component and record its classification information.

[0130] The method provided in this embodiment enables road components to be classified and managed according to multi-dimensional standards, forming a structured component library. This facilitates the system to accurately match and quickly retrieve the required road components. At the same time, by assigning a unique identifier to each component and recording classification information, traceable management of road components is achieved, improving the accuracy and efficiency of component selection during model generation. This not only enhances the interactive experience but also enriches the game scene, effectively solving the technical problems of large-scale road model management and retrieval in the computer field.

[0131] Specifically, the system establishes a multi-level classification system based on the different characteristics of road components. The components are classified hierarchically according to road function (such as elevated roads, tunnels, ramps, interchanges, etc.), model angle type (such as straight roads, 30-degree, 45-degree, 60-degree turns, etc.), and lane width (such as 4 lanes, 6 lanes, 8 lanes, etc.), forming a structured component library.

[0132] Among these factors, road function can serve as the primary classification criterion for road components. Road function refers to the specific role or purpose that a road component plays within the road system, and is used to distinguish different types of road structures.

[0133] Secondly, road functions typically determine the basic form and usage scenarios of road components.

[0134] In an alternative implementation, road functions may include different functional types such as elevated roads, at-grade roads, tunnel roads, ramps, and interchanges, each with unique structural features and usage scenarios. For example, elevated road components typically include a bridge deck and supporting structures, tunnel road components include tunnel entrances and internal structures, while ramp components are specifically designed to connect roads at different heights or in different directions.

[0135] In an alternative implementation, road functions can be further subdivided into subtypes such as arterial road functions, auxiliary road functions, and connecting road functions to meet the modeling needs of road networks of different scales and complexities. For example, in an urban scenario, arterial road components may have wider lanes and more complex traffic sign systems, while auxiliary road components are narrower and have simpler structures.

[0136] The model angle type can be a parameter describing the geometric features of a road component on a planar projection. The model angle type refers to the angle type formed by the road component at connections or turns, used to match road components with different turning requirements.

[0137] Secondly, the type of model angle usually serves to ensure that road components maintain geometric continuity and visual smoothness during the splicing process.

[0138] In an optional implementation, the model angle type may include straight roads (0 degrees), small-angle curves (such as 15 degrees, 30 degrees), medium-angle curves (such as 45 degrees, 60 degrees), and large-angle curves (such as 75 degrees, 90 degrees), and the appropriate angle type can be selected according to the actual needs of road turning.

[0139] Lane width is a crucial parameter that determines the lateral dimensions of road components. Lane width refers to the number of lanes on the cross-section of a road component and the width of each lane, directly affecting the road's traffic capacity and applicable scenarios.

[0140] Secondly, lane width typically plays a role in determining the overall proportions of road components and the applicable traffic flow.

[0141] In one alternative implementation, lane widths can be categorized by the number of lanes, such as two lanes (one lane in one direction), four lanes (two lanes in one direction), and six lanes (three lanes in one direction), each type corresponding to different levels of traffic demand. For example, in a scenario simulating an urban arterial road, a six-lane road component can be selected to represent busy traffic conditions.

[0142] Specifically, the system assigns a unique identifier to each road component in the component library and stores its classification information (including road function, model angle type, and lane width, etc.) in association with the identifier, which facilitates the rapid matching and retrieval of suitable road components through the attribute information of curve segments.

[0143] The unique identifier can be a string or code used to uniquely identify and reference road components within the system. The unique identifier is a unique code assigned to each road component, ensuring that the system can accurately identify and invoke specific components.

[0144] Secondly, unique identifiers typically serve to establish a one-to-one mapping between road components and their classification information.

[0145] In an alternative implementation, the unique identifier can adopt a structured naming rule, such as the format of "function-angle-width-serial number", for example "elevated-45 degrees-6 lanes-01", which intuitively reflects the classification information and characteristics of the component from the naming.

[0146] In an alternative implementation, the unique identifier can be associated with the physical file path of the component, making it easier for the system to directly locate and load the component resource file by the identifier.

[0147] In a method for generating a three-dimensional road model according to an embodiment of this application, before splicing the road components that match the curve segments, the method further includes: Based on the processed road curve, the selected road components are positioned, rotated, and deformed.

[0148] The method provided in this embodiment enables road components to be accurately placed in their corresponding positions and adapt to the geometric characteristics of road curves, thereby ensuring that the final generated 3D road model has a continuous and natural appearance. This preprocessing of road components greatly enhances the interactive experience; the precise positioning and natural transitions of the road model make navigation in the virtual environment smoother and more natural for users. Simultaneously, by deforming the road components, it can adapt to various complex road shapes, enhancing the richness of the game scene and making the virtual environment more realistic and diverse. From a technical perspective, this preprocessing mechanism effectively solves the model stitching problem in computer graphics, avoiding discontinuities and visual fragmentation at the stitching points, and ensuring the integrity and consistency of the final generated model.

[0149] Specifically, after selecting the road components, these components need to be accurately placed on the road curves, and the components need to be appropriately adjusted according to the geometric characteristics of the curves, including positioning, rotation and deformation processing, to ensure that the final assembled three-dimensional road model has continuity and natural transition effects.

[0150] The positioning process involves placing the road components into the correct positions in three-dimensional space based on the coordinates of sampling points on the processed road curve. Positioning typically ensures precise alignment between the road components and the road curve, providing an accurate spatial reference for subsequent splicing operations.

[0151] Rotation processing involves appropriately rotating road components according to the tangent and normal directions of the road curve. Rotation processing typically ensures that the extension direction of the road components aligns with the direction of the road curve and correctly handles road inclination and slope.

[0152] Deformation processing is the process of adjusting the geometry of road components according to the characteristics of road curves, adapting them to different road shapes and connection requirements. Deformation processing typically enables road components to adapt to changes in curve curvature, width, and connection requirements with other roads.

[0153] In a method for generating a three-dimensional road model according to an embodiment of this application, the selected road components are positioned, rotated, and deformed based on the processed road curves, including: Point sampling is performed on the processed road curve, and the distance between sampling points is dynamically adjusted according to the road type and width. Calculate the tangent and normal at each sampling point and establish a local coordinate system; The selected road components are positioned and rotated to their corresponding positions according to the local coordinate system. For the straight section of the road curve, the road component is stretched and deformed along the curve direction of the straight section; For the intersection of the road curves, the intersection component where the intersection is located is edge-blended with the connecting straight road component; and Inspect all connection points between components, and perform gap repair and mesh smoothing.

[0154] The method provided in this embodiment enables the system to accurately place and deform road components according to the geometric features of road curves, ensuring seamless connection between components, thereby generating a visually continuous, natural and beautiful three-dimensional road model.

[0155] Specifically, based on the processed road curve, the system needs to determine appropriate sampling points for subsequent placement of road components. The density of sampling points is dynamically adjusted according to the curvature of the road curve, the road type, and the road width. The sampling point density is higher in areas with greater curvature and lower in straight areas. Furthermore, different sampling strategies are required for different types of roads (such as elevated roads and tunnels) and roads of different widths (such as two-lane and multi-lane roads).

[0156] Specifically, for each sampling point on the road curve, the system needs to calculate the tangent vector and normal vector at that point to establish a local coordinate system. The tangent vector represents the road's forward direction at that point, while the normal vector is perpendicular to the road plane and can be calculated from the tangent and the global upward direction. This local coordinate system will serve as a reference system for placing road components, ensuring that the components are correctly aligned with the road's direction and tilt angle.

[0157] The local coordinate system can be a coordinate reference system established at each sampling point on the road curve, with that point as the origin and the curve tangent, normal, and binormal at that point as the coordinate axes. The local coordinate system typically provides a spatial reference frame for component placement, used to determine the precise position and orientation of road components in three-dimensional space.

[0158] Specifically, using the local coordinate system established in the previous step, the system places road components (such as road sections, guardrails, bridge piers, etc.) selected from the component library onto their corresponding positions on the road curve through coordinate transformation. This process involves transforming the components from their local coordinate system to the local coordinate system of the corresponding sampling point, involving translation and rotation operations. For different types of components, different offset values ​​and rotation angles may need to be applied to ensure correct connection between components.

[0159] Component positioning and rotation are processes that place selected road components in the correct position and orientation in three-dimensional space, guided by a local coordinate system. Component positioning and rotation typically ensure that road components conform to the geometric features of road curves, thereby achieving a visually continuous and structurally sound road model.

[0160] Specifically, for the straight sections of road curves, the system does not need to place a large number of standard-length components separately. Instead, a more efficient approach can be taken: the basic straight-line components are appropriately stretched and deformed along the curve to match the length of the straight section. This reduces the number of component joints, improving model quality and rendering efficiency.

[0161] Stretching deformation can be a process of adjusting the dimensions of a standard road component along its length based on the straight section length. Stretching deformation typically reduces the number of model seams and optimizes rendering performance, and is used to generate continuous road models whose length matches the actual road curves.

[0162] Specifically, intersections in the road network (such as crossroads, T-junctions, and overpasses) require specialized intersection components. These components need to undergo edge blending with the connecting straight road components to ensure a smooth transition between them. The blending process involves adjusting the geometry, texture, and material parameters of the component edges to make the junction appear natural and continuous, without obvious splicing marks.

[0163] Edge blending is a technique that adjusts the geometry and texture of the contact edges between intersecting components and connected straight road components to achieve a visually seamless connection. Edge blending typically eliminates component seam marks and enhances the continuity of the overall road model, creating a visually unified road network.

[0164] Specifically, after all road components are placed, the system needs to perform a comprehensive inspection of the connection points between the components to identify potential gaps, overlaps, or unevenness. For the problem areas found, the system will perform gap repair operations, such as adding fill geometry, adjusting vertex positions, merging overlapping parts, etc., and smooth the mesh to ensure that the final generated road model is visually and functionally continuous and complete.

[0165] Among these, gap repair and mesh smoothing are post-processing techniques used to identify and correct geometric problems at the joints between road components, improving the overall model quality. Gaps repair and mesh smoothing typically eliminate visual imperfections and enhance model integrity, ensuring that the generated 3D road model maintains a high-quality appearance from any angle.

[0166] Based on the above method embodiments, this disclosure also provides a device for generating a three-dimensional road model, see [link to relevant documentation]. Figure 3 The device includes the following modules: The acquisition module 301 is used to acquire road curves, which include multiple curve segments; The determination module 302 is used to determine the curve type of each curve segment, including the curve type of the plane road and the curve type of the grade-separated road. The processing module 303 is used to process the curve segments based on preset processing rules if the curve segments are of the three-dimensional road type, and generate the processed road curve. Select module 304 is used to select a road component that matches the curve segment from a preset component library based on the attribute information corresponding to the curve segment. The generation module 305 is used to splice together the road components that match the segments of the processed road curves to obtain a three-dimensional road model.

[0167] The aforementioned device acquires road curves, segments each curve, and determines the curve type of each segment, including planar road types and three-dimensional road types. If a curve segment is a three-dimensional road type, it processes the segment based on preset processing rules to generate a processed road curve. Based on the attribute information corresponding to the curve segment, it selects road components matching the curve segment from a preset component library. Finally, it splices together the matching road components for each curve segment according to the processed road curve to obtain a three-dimensional spatial road model. The method provided in this disclosure allows users to quickly generate complex three-dimensional spatial road models through simple curve editing and attribute settings; it also supports flexible combinations of various road types and components, enriching the expressiveness of game scenes.

[0168] The apparatus for generating three-dimensional road models provided in this disclosure has the same implementation principle and technical effects as the aforementioned method embodiments. For the sake of brevity, any parts not mentioned in the embodiments of the generating apparatus can be referred to the corresponding content in the aforementioned embodiments of the method for generating three-dimensional road models.

[0169] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0170] This disclosure also provides an electronic device, such as... Figure 4The diagram shows the structure of the electronic device, which includes a processor 111 and a memory 110. The memory 110 stores computer-executable instructions that can be executed by the processor 111. The processor 111 executes the computer-executable instructions to implement the following steps of the method for generating a three-dimensional road model: Obtain road curves, which include multiple curve segments; For each curve segment, determine the curve type of the curve segment. The curve type includes level road type and grade-separated road type. If the curve segment is a three-dimensional road type, the curve segment is processed based on the preset processing rules to generate the processed road curve; Based on the attribute information corresponding to the curve segment, select the road component that matches the curve segment from the preset component library; Based on the processed road curves, the road components that match the curve segments are spliced ​​together to obtain a three-dimensional road model.

[0171] Optionally, if the curve segment is a grade-separated road type, the curve segment is processed based on preset processing rules to generate a processed road curve, including: if the curve segment is a grade-separated road type, determining the grade-separated road subtype to which the curve segment belongs; processing the curve segment based on the specified processing rules corresponding to the grade-separated road subtype to generate a processed road curve.

[0172] Optionally, the subtype of grade-separated road includes at least one of the following: elevated type, tunnel type, ramp type, and interchange type.

[0173] Optionally, if the curve segment is of the elevated type, the specified processing rules include: comparing the height value of a specified point on the curve segment with the height value of the corresponding terrain; when the specified point is higher than the height value of the corresponding terrain, the curve segment is marked as a suspended segment; when the specified point is lower than the height value of the corresponding terrain, the curve segment is marked as a cut-down segment.

[0174] Optionally, if the curve segment is of the ramp type, the specified processing rules include: for the connection between the ramp type curve segment and the elevated type curve segment, calculate the slope of the elevated type curve segment at the connection point, and perform offset compensation on the ramp type curve segment based on the slope.

[0175] Optionally, if the curve segment is of the tunnel type, the specified processing rules include: extending a predetermined distance at both ends of the tunnel-type curve segment and performing smooth straightening processing.

[0176] Optionally, the piecewise curve carries a road type identifier, which is used to characterize the type of road components required by the piecewise curve.

[0177] Optionally, the method further includes: establishing a three-layer curve attribute system for road curves, comprising a control point layer, a segment layer, and an overall layer; wherein, the control point layer is used to set the attributes of point position, point normal, and tangent; the segment layer is used to set the attributes of the width, height, and road component type of curve segments; and the overall layer is used to set global attributes applicable to the entire road.

[0178] Optionally, the method also includes: providing a visual interface for editing the three-layer structure curve attribute system; and exporting the data of the three-layer structure curve attribute system in a preset format.

[0179] Optionally, before selecting a matching road component from a preset component library, the method further includes: classifying the road components according to road function, model angle type, and lane width; assigning a unique identifier to each road component and recording its classification information.

[0180] Optionally, before splicing the road components that match the curve segments, the method further includes: positioning, rotating and deforming the selected road components according to the processed road curves.

[0181] Optionally, based on the processed road curve, the selected road components are positioned, rotated, and deformed, including: sampling points on the processed road curve, with the distance between sampling points dynamically adjusted according to the road type and width; calculating the tangent and normal at each sampling point to establish a local coordinate system; positioning and rotating the selected road components to their corresponding positions according to the local coordinate system; stretching and deforming the road components along the curve direction of the straight sections of the road curve; performing edge blending processing on the intersecting components placed at the intersections of the road curves and the connected straight sections; and detecting the connection points between all components and performing gap repair and mesh smoothing processing.

[0182] exist Figure 4 In the illustrated embodiment, the electronic device further includes a bus 112 and a communication interface 113, wherein the processor 111, the communication interface 113, and the memory 110 are connected via the bus 112.

[0183] The memory 110 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 113 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 112 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 112 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0184] The processor 111 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 111 or by instructions in software form. The processor 111 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor 111 reads the information in the memory and, in conjunction with its hardware, completes the steps of the three-dimensional road model generation method of the aforementioned embodiment.

[0185] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement a method for generating a three-dimensional road model. The method specifically includes: Obtain road curves, which include multiple curve segments; For each curve segment, determine the curve type of the curve segment. The curve type includes level road type and grade-separated road type. If the curve segment is a three-dimensional road type, the curve segment is processed based on the preset processing rules to generate the processed road curve; Based on the attribute information corresponding to the curve segment, select the road component that matches the curve segment from the preset component library; Based on the processed road curves, the road components that match the curve segments are spliced ​​together to obtain a three-dimensional road model.

[0186] Optionally, if the curve segment is a grade-separated road type, the curve segment is processed based on preset processing rules to generate a processed road curve, including: if the curve segment is a grade-separated road type, determining the grade-separated road subtype to which the curve segment belongs; processing the curve segment based on the specified processing rules corresponding to the grade-separated road subtype to generate a processed road curve.

[0187] Optionally, the subtype of grade-separated road includes at least one of the following: elevated type, tunnel type, ramp type, and interchange type.

[0188] Optionally, if the curve segment is of the elevated type, the specified processing rules include: comparing the height value of a specified point on the curve segment with the height value of the corresponding terrain; when the specified point is higher than the height value of the corresponding terrain, the curve segment is marked as a suspended segment; when the specified point is lower than the height value of the corresponding terrain, the curve segment is marked as a cut-down segment.

[0189] Optionally, if the curve segment is of the ramp type, the specified processing rules include: for the connection between the ramp type curve segment and the elevated type curve segment, calculate the slope of the elevated type curve segment at the connection point, and perform offset compensation on the ramp type curve segment based on the slope.

[0190] Optionally, if the curve segment is of the tunnel type, the specified processing rules include: extending a predetermined distance at both ends of the tunnel-type curve segment and performing smooth straightening processing.

[0191] Optionally, the piecewise curve carries a road type identifier, which is used to characterize the type of road components required by the piecewise curve.

[0192] Optionally, the method further includes: establishing a three-layer curve attribute system for road curves, comprising a control point layer, a segment layer, and an overall layer; wherein, the control point layer is used to set the attributes of point position, point normal, and tangent; the segment layer is used to set the attributes of the width, height, and road component type of curve segments; and the overall layer is used to set global attributes applicable to the entire road.

[0193] Optionally, the method also includes: providing a visual interface for editing the three-layer structure curve attribute system; and exporting the data of the three-layer structure curve attribute system in a preset format.

[0194] Optionally, before selecting a matching road component from a preset component library, the method further includes: classifying the road components according to road function, model angle type, and lane width; assigning a unique identifier to each road component and recording its classification information.

[0195] Optionally, before splicing the road components that match the curve segments, the method further includes: positioning, rotating and deforming the selected road components according to the processed road curves.

[0196] Optionally, based on the processed road curve, the selected road components are positioned, rotated, and deformed, including: sampling points on the processed road curve, with the distance between sampling points dynamically adjusted according to the road type and width; calculating the tangent and normal at each sampling point to establish a local coordinate system; positioning and rotating the selected road components to their corresponding positions according to the local coordinate system; stretching and deforming the road components along the curve direction of the straight sections of the road curve; performing edge blending processing on the intersecting components placed at the intersections of the road curves and the connected straight sections; and detecting the connection points between all components and performing gap repair and mesh smoothing processing.

[0197] The computer program products of the method, apparatus and electronic device for generating three-dimensional road models provided in this disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0198] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0199] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0200] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0201] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A method for generating a three-dimensional road model, characterized in that, include: Obtain a road curve, which includes multiple curve segments; For each curve segment, the curve type of the curve segment is determined, and the curve type includes level road type and grade-separated road type; If the curve segment is a three-dimensional road type, the curve segment is processed based on preset processing rules to generate a processed road curve; Based on the attribute information corresponding to the curve segment, select a road component that matches the curve segment from the preset component library; Based on the processed road curves, the road components that match the curve segments are spliced ​​together to obtain a three-dimensional road model.

2. The method according to claim 1, characterized in that, If the curve segment is a three-dimensional road type, the curve segment is processed based on preset processing rules to generate a processed road curve, including: If the curve segment is a three-dimensional road type, determine the three-dimensional road subtype to which the curve segment belongs; The curve is segmented and processed according to the specified processing rules corresponding to the three-dimensional road subtype to generate the processed road curve.

3. The method according to claim 2, characterized in that, The subtypes of the grade-separated road include at least one of the following: elevated type, tunnel type, ramp type, and interchange type.

4. The method according to claim 3, characterized in that, If the curve segment is of the elevated type, the specified processing rules include: The height value of a specified point on the curve segment is compared with the height value of the corresponding terrain. When the specified point is higher than the height value of the corresponding terrain, the curve segment is marked as a suspended segment; when the specified point is lower than the height value of the corresponding terrain, the curve segment is marked as a leveled segment.

5. The method according to claim 3, characterized in that, If the curve segment is of the ramp type, the specified processing rules include: For the junction of the ramp-type curve segment and the elevated-type curve segment, the slope of the elevated-type curve segment at the junction is calculated, and offset compensation is performed on the ramp-type curve segment based on the slope.

6. The method according to claim 3, characterized in that, If the curve segment is of the tunnel type, the specified processing rules include: Extend a predetermined distance at each end of the curved segment of the tunnel type and perform a smoothing and straightening process.

7. The method according to claim 1, characterized in that, The segmented curve carries a road type identifier, which is used to characterize the type of road component required by the segmented curve.

8. The method according to claim 1, characterized in that, The method further includes: For the road curve, a three-layer curve attribute system is established, including a control point layer, a segment layer, and an overall layer; The control point layer is used to set the attributes of point position, point normal, and tangent; the segment layer is used to set the attributes of curve segment width, height, and road component type; and the global layer is used to set global attributes applicable to the entire road.

9. The method according to claim 8, characterized in that, The method further includes: Provides a visual interface for editing the three-layer structure curve attribute system; and The data of the three-layer structure curve attribute system is exported using a preset format.

10. The method according to claim 1, characterized in that, Before selecting a matching road component from a preset component library, the method further includes: Road components are classified according to road function, model angle type, and lane width; Assign a unique identifier to each road component and record its classification information.

11. The method according to claim 1, characterized in that, Before splicing the road components that match the curve segments, the method further includes: Based on the processed road curve, the selected road component is positioned, rotated, and deformed.

12. The method according to claim 11, characterized in that, The step of positioning, rotating, and deforming the selected road component based on the processed road curve includes: Point sampling is performed on the processed road curve, and the distance between sampling points is dynamically adjusted according to the road type and width. Calculate the tangent and normal at each sampling point and establish a local coordinate system; The selected road components are positioned and rotated to their corresponding positions according to the local coordinate system. For the straight section of the road curve, the road component is stretched and deformed along the curve direction of the straight section; For the intersection of the road curves, the intersection component where the intersection is located is edge-blended with the connecting straight road component; and Inspect all connection points between components and perform gap repair and mesh smoothing.

13. A device for generating a three-dimensional road model, characterized in that, include: The acquisition module is used to acquire road curves, which include multiple curve segments; The determination module is used to determine the curve type of each curve segment, including the curve type of a plane road and the curve type of a grade-separated road. The processing module is used to process the curve segment based on preset processing rules if the curve segment is a three-dimensional road type, and generate a processed road curve. The selection module is used to select a road component that matches the curve segment from a preset component library based on the attribute information corresponding to the curve segment. The generation module is used to splice together the road components that match the segments of the processed road curves to obtain a three-dimensional road model.

14. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 12.