Virtual road generation method and device, computer program product and electronic equipment

By using road control curves and segmented control parameters composed of multiple curves, virtual roads are generated, which solves the problem of insufficient controllability, flexibility and diversity of virtual road generation in the prior art, and achieves efficient and flexible virtual road generation.

CN119868941AActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Application Number
CN202510255746.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-04-25
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

In the prior art, the controllability, flexibility and diversity of virtual road generation are poor, resulting in low generation efficiency and insufficient applicability.

Method used

By obtaining the road control curve composed of multiple curve segments, the target road model unit is determined and adjusted from the candidate road model unit according to the segment control parameters of each curve segment, and splicing it according to the position of the curve segments to generate a virtual road matching the road control curve.

Benefits of technology

It enhances the controllability, flexibility and diversity of road model generation, improves the generation efficiency of virtual roads and ensures the generation quality, and is suitable for game projects of larger sizes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119868941A_ABST
    Figure CN119868941A_ABST
Patent Text Reader

Abstract

The invention provides a virtual road generation method and device, a computer program product and electronic equipment, and relates to the technical field of games. The method comprises the steps that a road control curve is obtained, wherein the road control curve is composed of a plurality of curve segments; each curve segment is respectively configured with segment control parameters; determining a target road model unit corresponding to each curve segment from the candidate road model units according to the segment control parameter corresponding to each curve segment, and adjusting the target road model unit corresponding to each curve segment; according to the positions of the curve segments in the road control curve, the target road model units corresponding to the curve segments are spliced, a virtual road matched with the road control curve is obtained, the controllability, flexibility and diversity of road model generation can be enhanced to a certain degree, and the method is suitable for game items with large sizes and volumes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of game technology, and in particular to a virtual road generation method, a virtual road generation device, a computer program product, and an electronic device. Background Art

[0002] In game scenes, various scene areas are usually connected together through virtual roads. As virtual roads are areas where players' game characters will frequently step on, the quality of the virtual roads will directly affect the players' gaming experience.

[0003] In the related art, virtual roads are usually generated in the following two ways: one is to manually place the required prefabricated road models in the game scene through art scene editing to generate virtual roads. This method requires a lot of manpower and time costs, has low generation efficiency, and is not suitable for game projects of larger sizes; the other is to draw road curves of specific shapes, and generate road models according to the direction of the drawn road curves using a programmed road model generation algorithm. Compared with the first method, although the efficiency is improved, the artistic effects that can be achieved are usually simpler. Once the requirements change, a large amount of additional development costs will be generated, and the controllability, flexibility and diversity are poor.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The present disclosure provides a virtual road generation method, a virtual road generation device, a computer program product and an electronic device, so as to at least to some extent solve the problems of poor controllability, flexibility and diversity of virtual road generation in related technologies.

[0006] According to a first aspect of the present disclosure, a method for generating a virtual road is provided, the method comprising: obtaining a road control curve, the road control curve being composed of a plurality of curve segments; each of the curve segments being respectively configured with a segment control parameter; determining a target road model unit corresponding to each of the curve segments from candidate road model units according to the segment control parameters corresponding to each of the curve segments, and adjusting the target road model unit corresponding to each of the curve segments; splicing the target road model units corresponding to each of the curve segments according to the position of each of the curve segments in the road control curve, to obtain a virtual road matching the road control curve.

[0007] According to a second aspect of the present disclosure, a virtual road generation device is provided, the device comprising: a control curve acquisition module, used to acquire a road control curve, the road control curve being composed of a plurality of curve segments; each of the curve segments being respectively configured with a segment control parameter; a model unit determination module, used to determine a target road model unit corresponding to each of the curve segments from candidate road model units according to the segment control parameters corresponding to each of the curve segments, and to adjust the target road model unit corresponding to each of the curve segments; and a road model generation module, used to splice the target road model units corresponding to each of the curve segments according to their positions in the road control curve, to obtain a virtual road matching the road control curve.

[0008] According to a third aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the virtual road generation method of the first aspect and possible implementation methods thereof are implemented.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the virtual road generation method of the above-mentioned first aspect and its possible implementation method by executing the executable instructions.

[0010] The technical solution disclosed in this disclosure has the following beneficial effects:

[0011] In the above virtual road generation process, a road control curve is obtained, and the road control curve is composed of multiple curve segments; each curve segment is respectively configured with a segment control parameter; according to the segment control parameter corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model unit, and the target road model unit corresponding to each curve segment is adjusted; according to the position of each curve segment in the road control curve, the target road model unit corresponding to each curve segment is spliced ​​to obtain a virtual road matching the road control curve. On the one hand, in the present disclosure, the road control curve is composed of multiple curve segments and each curve segment is respectively configured with a segment control parameter, so that the user only needs to adjust the segment control parameter to meet various road production needs, which can enhance the controllability, flexibility and diversity of road model generation to a certain extent. On the other hand, in the present invention, by using the segment control parameters corresponding to each curve segment in the road control curve, corresponding road model component units are selected from the candidate road model units and adjusted and spliced, without the need to make the model from scratch. This not only improves the efficiency of virtual road generation but also ensures the quality of virtual road generation, and can be better applied to game projects of larger sizes. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 A flowchart showing a method for generating a virtual road in this exemplary embodiment is shown;

[0013] Figure 2 A flowchart of adjusting the target road model unit at the curve segment level in this exemplary embodiment is shown;

[0014] Figure 3 A flow chart of adjusting the angle in this exemplary embodiment is shown;

[0015] Figure 4 A flowchart of generating a virtual road based on road control curve control in this exemplary embodiment is shown;

[0016] Figure 5 A structural block diagram of a virtual road generating device in this exemplary embodiment is shown;

[0017] Figure 6 An electronic device for implementing the above-mentioned virtual road generation method in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0018] Exemplary embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings.

[0019] The accompanying drawings are schematic diagrams of the present disclosure and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings may be functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in hardware modules or integrated circuits, or in networks, processors or microcontrollers. The embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the description below, many specific details are provided to provide a full description of the embodiments of the present disclosure. However, those skilled in the art should appreciate that one or more specific details may be omitted when implementing the technical solution of the present disclosure, or one or more specific details may be replaced by other methods, components, devices, steps, etc.

[0020] In the related art, the required prefabricated road models are manually placed in the game scene through the art scene editor to generate virtual roads. This method requires a lot of manpower and time costs, has low generation efficiency, and is not suitable for game projects of larger sizes.

[0021] In the related art, a road model is generated by drawing a road curve of a specific shape and using a programmed road model generation algorithm according to the direction of the drawn road curve. In this way, the attributes that the road curve can carry are greatly restricted, and the artistic effects that can be achieved are relatively simple. Once the requirements change, a large amount of additional development costs will be generated, and the controllability, flexibility and diversity are poor.

[0022] In view of one or more of the above problems, exemplary embodiments of the present disclosure provide a virtual road generation method, a virtual road generation device, a computer program product, and an electronic device.

[0023] In an optional embodiment, reference Figure 1 As shown, a flowchart of a virtual road generation method is provided, which specifically includes the following steps S110 to S130:

[0024] Step S110, obtaining a road control curve, the road control curve is composed of a plurality of curve segments; each curve segment is respectively configured with a segment control parameter;

[0025] Step S120, determining a target road model unit corresponding to each curve segment from the candidate road model units according to the segment control parameters corresponding to each curve segment, and adjusting the target road model unit corresponding to each curve segment;

[0026] Step S130, according to the position of each curve segment in the road control curve, the target road model units corresponding to each curve segment are spliced ​​to obtain a virtual road matching the road control curve.

[0027] Figure 1 In the method shown, the road control curve is composed of multiple curve segments and each curve segment is respectively configured with a segment control parameter, so that the user only needs to adjust the segment control parameters to meet various road production requirements, which can enhance the controllability, flexibility and diversity of road model generation to a certain extent; through the segment control parameters corresponding to each curve segment in the road control curve, the corresponding road model component unit is selected from the candidate road model unit and spliced ​​after adjustment, without the need to start model production from scratch, which not only improves the generation efficiency of virtual roads but also ensures the generation quality of virtual roads, and can be better applied to game projects of larger sizes.

[0028] Below Figure 1 Provide detailed instructions for each step.

[0029] In step S110, a road control curve is obtained, where the road control curve is composed of a plurality of curve segments; each curve segment is respectively configured with a segment control parameter.

[0030] The road control curve refers to a curve used to control the type and shape of virtual road generation. The segment control parameter refers to a control parameter used to control the type and shape of the road model at the predefined curve segment level, which may include but is not limited to attribute types such as road type, road height, road width, and road length. The attribute parameter values ​​can be flexibly edited by the user according to needs, and this disclosure does not specifically limit this.

[0031] Optionally, the road control curve may be composed of multiple curve segments, and each curve segment may be composed of at least two control points. Taking the case where a curve segment is composed of two control points as an example, when there are 5 control points on a road control curve without bifurcations, 4 curve segments may be formed.

[0032] In some embodiments, a road control curve consisting of multiple curve segments can be edited by a curve editing tool for use. Exemplarily, the road control curve can be obtained by a curve editing tool in a game engine, and a specific preset format (e.g., json format) is used as a carrier for storage to produce a road control curve. When a road control curve produced by a game engine is obtained by a three-dimensional computer graphics software (e.g., Houdini), the stored file in a specific preset format can be converted into a usable curve format in the three-dimensional computer graphics software to facilitate identification of various curve data associated with the road control curve, such as road control parameters at the overall level, road control parameters at the segment level (i.e., segment control parameters), and road control parameters at the control point level (i.e., node control parameters). It should be noted that the types of road control parameters at different hierarchical structures can be pre-set or added by the user, and this disclosure does not limit this.

[0033] In an optional implementation, after the road control curve is acquired, the following steps may be performed: smoothing each curve segment in the road control curve to obtain each adjusted curve segment.

[0034] For example, it is possible to calculate whether the height transition of each curve segment and adjacent curve segments in the road control curve exceeds a preset height transition threshold, that is, whether the height rise or fall value within a unit length exceeds a preset height difference. If so, the curve portion exceeding the preset height transition threshold can be height-smoothed. Through height smoothing, the height transition can be dispersed to a larger range for transition, making the generated virtual road smoother.

[0035] For example, it is possible to calculate whether the curvature of the corners of each curve segment and the adjacent curve segments in the road control curve exceeds a preset curvature threshold. If so, the portion of the curve that exceeds the preset curvature threshold can be subjected to curvature smoothing. Through curvature smoothing, the turning angle can be dispersed over a larger range for transition, making the generated virtual road smoother. Furthermore, by performing curvature smoothing on the road control curve, it is also possible to avoid wrinkles of varying degrees in areas with excessively large turning angles after the road model unit is applied, thereby improving the performance of the virtual road.

[0036] In step S120, according to the segment control parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted.

[0037] The candidate road model unit refers to a pre-created road splicing component. Various road splicing components that may be used to generate virtual roads in game scenes, namely candidate road model units, can be pre-made, and these road splicing components are stored separately in a preset format (for example, fbx format) for use.

[0038] Exemplarily, the candidate road model units may include, but are not limited to, model units for generating straight roads and their variants, model units for generating intersections with merging angles of specific angles, etc., which are not specifically limited in the present disclosure.

[0039] Exemplarily, the candidate road model units may also include model units with different numbers of lanes, such as 8 lanes, 6 lanes, 4 lanes, etc., which is not specifically limited in the present disclosure.

[0040] Exemplarily, the candidate road model units may also include, but are not limited to, ordinary roads, tunnels, elevated roads, ramps, etc., which are not specifically limited in the present disclosure.

[0041] It should be noted that, in practical applications, the road model units can be divided into different road types according to actual needs for users to select and configure.

[0042] Optionally, the created candidate road model units can be put into storage for subsequent use. Exemplarily, the asset storage panel developed in the Unreal Engine can be used to implement storage management. Specifically, for ease of management, the road model unit can be exported to the corresponding path in a specific preset format (such as fbx format) while exporting the configuration file (such as a json file) of the road model unit to the corresponding path. Optionally, the stored road model units can be pre-processed for normalization and scaling to facilitate subsequent use. The present disclosure generates the road model units required for a complete virtual road through storage management, i.e., the candidate road model units, thereby improving the convenience of managing the number and types of model assets. When more road model unit variants need to be added, it is only necessary to add a new form bar in the component model storage interface to complete the data storage of the model unit and the export of the model unit.

[0043] Optionally, a road type parameter may be defined in the segment control parameter, so as to determine a target road model unit corresponding to each curve segment from the candidate road model units based on the road type parameter corresponding to each curve segment.

[0044] The target road model unit refers to a model unit extracted from the candidate road model units and matching the segmentation control parameters of the curve segment.

[0045] For example, when adjusting the target road model unit corresponding to each curve segment, deformation, rotation, scaling and other types of adjustments may be performed based on each curve segment, so as to flexibly control the presentation effect of the target road model through the curve segment.

[0046] Optionally, road shape parameters may also be defined in the segment control parameters so as to adjust the target road model unit corresponding to each curve segment at the curve segment level.

[0047] In an optional implementation, the segment control parameters include road type parameters and road shape parameters. According to the segment control parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted. Figure 2 The steps shown are to achieve this:

[0048] Step S210, determining a target road model unit corresponding to each curve segment from candidate road model units according to the road type parameters corresponding to each curve segment;

[0049] Step S220: adjusting the target road model unit corresponding to each curve segment according to the road shape parameter corresponding to each curve segment.

[0050] The road type parameter refers to the configuration parameter for the road model unit type, such as a straight road, a cross-merging road, an 8-lane, a 6-lane, or a 4-lane road, a normal road, a tunnel, an elevated road, or a ramp.

[0051] Exemplarily, the target road model unit that matches the road type parameters of each curve segment can be determined by reading the road type parameters corresponding to the corresponding curve segment recorded on each curve segment and comparing them with the configuration files of the stored candidate road model units.

[0052] After determining the target road model units that match the road type parameters of each curve segment, the target road model units may be further adjusted to improve the splicing effect between the target road model units.

[0053] Among them, the road shape parameters refer to control parameters that can affect the road shape (such as road width, road length, road height, road curvature, etc.). By adjusting the target road model unit corresponding to each curve segment according to the road shape parameters corresponding to each curve segment, the target road model unit can better adapt to the road control curve.

[0054] Exemplarily, the target road model unit corresponding to each curve segment may be scaled according to the road width parameter and / or road length attribute of each curve segment.

[0055] Exemplarily, the target road model unit corresponding to each curve segment may be deformed according to the road height parameter and / or the road curvature parameter of each curve segment.

[0056] Figure 2 The steps in realize the adjustment of the target road model unit at the curve segment level, which can improve the flexibility and freedom of user editing.

[0057] In an optional embodiment, each curve segment is composed of at least two control points, each control point is respectively configured with a node control parameter, and the target road model unit corresponding to each curve segment is adjusted. It can also be achieved by the following steps: according to the node control parameters corresponding to each control point, the target road model unit corresponding to each curve segment is adjusted.

[0058] The node control parameters refer to control parameters at a predefined node level for controlling the shape of the road model.

[0059] Optionally, road width parameters, road height parameters, road curvature parameters and other types can be defined in the node control parameters to adjust the target road model units corresponding to each curve segment from the node level to improve the editing accuracy of the virtual road. It should be noted here that in actual application, some road control parameters can be set at the node level, at the curve segment level, or at the overall level. Different settings at different levels will result in different performance accuracy of the virtual road. For example, road width parameters, road height parameters, road curvature parameters, etc. can be customized according to actual needs, and this disclosure does not specifically limit this. By customizing road control parameters at different levels, users can achieve a high degree of controllability in the generation of virtual roads.

[0060] Exemplarily, the target road model unit corresponding to each curve segment may be scaled according to the road width parameter corresponding to each control point.

[0061] Exemplarily, the target road model unit corresponding to each curve segment may be deformed according to the road height parameter and / or road curvature parameter corresponding to each control point.

[0062] In an optional embodiment, the above-mentioned adjustment of the target road model unit corresponding to each curve segment can also be achieved through the following steps: obtaining the overall control parameters defined for the road control curve, and adjusting the target road model unit corresponding to each curve segment according to the overall control parameters.

[0063] The overall control parameter refers to a control parameter used to control the shape of the road model at a predefined overall level. For example, the overall control parameter may define a road material, such as an asphalt road, a concrete road, etc., which is not specifically limited in the present disclosure.

[0064] In some embodiments, the material of the target road model unit may be adjusted according to the road material parameters.

[0065] By adjusting the target road model unit through control parameters at different levels, the quality of virtual road generation can be ensured to a certain extent while ensuring the convenience of user editing.

[0066] In an optional embodiment, after obtaining the road control curve as mentioned above, the following steps can also be performed: determine the curve intersection point between each curve segment, and judge whether the angle between the curve segments connected to the curve intersection point meets the preset conditions; if not, adjust the angle between the curve segments connected to the curve intersection point so that the angle meets the preset conditions.

[0067] Exemplarily, a curve intersection point refers to a control point connected to at least three curve segments, that is, a point where a bifurcation occurs in a road control curve, which is a subset of the control points.

[0068] The preset condition refers to a condition set in advance for adjusting the curve intersection portion. By setting the preset condition, the curve intersection angle can be normalized so that a more suitable target road model unit can be determined from the candidate road models.

[0069] In an optional embodiment, the above-mentioned judgment of whether the angle between the curve segments connected to the curve intersection point meets the preset conditions can be achieved through the following steps: judging whether the angle between the curve segments connected to the curve intersection point belongs to a subset of the preset angle set.

[0070] Among them, the preset angle set refers to a set of one or more pre-set normalized angles, such as a 30-degree angle, a 45-degree angle, a 90-degree angle, etc., which can correspond to the road model units related to the intersection and convergence angle in the candidate road model units to normalize the fork angles and increase the fit between the road model units and the curves.

[0071] Exemplarily, it can be determined whether the angle between the curve segments connected to the curve intersection point belongs to a subset of a preset angle set. If so, it can be considered that the preset condition is met; if not, it can be considered that the preset condition is not met.

[0072] If the angle between the curve segments connected to the curve intersection point meets the preset conditions, the angle between the curve segments connected to the curve intersection point may not be adjusted.

[0073] If the angle between the curve segments connected to the curve intersection point does not meet the preset conditions, the angle between the curve segments connected to the curve intersection point can be adjusted.

[0074] For example, Figure 3 As shown, a schematic diagram of a process for adjusting the angle is provided, which may specifically include the following steps:

[0075] Step S301, determining the curve intersection point between each curve segment;

[0076] Step S302, determining whether the angle between the curve segments connected to the curve intersection point belongs to a subset of the preset angle set; if yes, proceed to step S303, if no, proceed to step S304;

[0077] Step S303, not adjusting the angle between the curve segments connected to the curve intersection point;

[0078] Step S304: adjusting the angle between the curve segments connected to the curve intersection point so that the angle belongs to a subset of the preset angle set.

[0079] In an optional embodiment, the above-mentioned adjustment of the angle between the curve segments connected to the curve intersection point so that the angle satisfies the preset condition can be achieved through the following steps: determining the angle difference between the angle between the curve segments connected to the curve intersection point and each angle in the preset angle set; determining the target angle from the preset angle set based on the angle difference; and adjusting the angle between the curve segments connected to the curve intersection point based on the target angle.

[0080] Exemplarily, the angle difference between the angle between the curve segments connected to the curve intersection and the angles in the preset angle set can be determined, and the angle with the smallest angle difference is selected from the preset angle set as the target angle, and the angle between the curve segments connected to the curve intersection is adjusted to the target angle to normalize the fork angle.

[0081] In an optional embodiment, the above-mentioned curve intersection is configured with an intersection control parameter, and the target road model unit corresponding to each curve segment is adjusted. It can also be achieved by the following steps: according to the intersection control parameter, the target road model unit corresponding to the curve segment connected to the curve intersection is adjusted.

[0082] The intersection control parameters refer to the parameters set at the intersection level to control the connection of forked roads, which can realize flexible editing of forked roads and further enhance the controllability of road generation. For example, the intersection control parameters can define parameters such as width control parameters and rotation control parameters.

[0083] In an optional embodiment, the above-mentioned adjustment of the target road model unit corresponding to the curve segment connected to the curve intersection point according to the intersection control parameters can be achieved through the following steps: scaling the target road model unit corresponding to the curve segment connected to the curve intersection point according to the width control parameters in the intersection control parameters; and / or rotating the target road model unit corresponding to the curve segment connected to the curve intersection point according to the rotation control parameters in the intersection control parameters.

[0084] For example, when scaling the target road model unit corresponding to the curve segment connected to the curve intersection point according to the width control parameter in the intersection control parameter, the target road model unit may be scaled as a whole, or only the connecting end of the target road model unit may be scaled. The present disclosure does not specifically limit this.

[0085] For example, when rotating the target road model unit corresponding to the curve segment connected to the curve intersection point according to the rotation control parameters in the intersection control parameters, the orientation of the target road model unit is adjusted, which can flexibly meet different placement scenarios of the road model unit.

[0086] In step S130, according to the position of each curve segment in the road control curve, the target road model units corresponding to each curve segment are spliced ​​to obtain a virtual road matching the road control curve.

[0087] Specifically, the corresponding target road model units may be spliced ​​together in sequence according to the positions of the curve segments in the road control curve, so as to obtain a virtual road matching the road control curve.

[0088] In an optional embodiment, the connecting ends of the interconnected target road model units may be deformed or scaled according to the road shape parameters corresponding to the interconnected curve segments and / or the node control parameters of the connecting control points corresponding to the interconnected curve segments, so as to achieve seamless and smooth connection between the model units and enhance the presentation effect of the virtual road.

[0089] For example, Figure 4 As shown, a flowchart of generating a virtual road based on road control curve control is provided, which may specifically include the following steps:

[0090] Step S401, obtaining a road control curve, the road control curve is configured with overall control parameters; the road control curve is composed of multiple curve segments, each curve segment is respectively configured with segment control parameters; each curve segment is composed of at least two control points, each control point is respectively configured with node control parameters;

[0091] Step S402, determining a target road model unit corresponding to each curve segment from candidate road model units according to a road type parameter in a segment control parameter corresponding to each curve segment;

[0092] Step S403, adjusting the target road model unit corresponding to each curve segment according to the overall control parameter, the node control parameter corresponding to each control point, and the road shape parameter in the segment control parameter corresponding to each curve segment;

[0093] Step S404: splicing the target road model units corresponding to each curve segment according to the position of each curve segment in the road control curve to generate a virtual road.

[0094] Figure 4In the steps shown, by dividing the road control curve into different levels and subdividing the attribute configuration, the control accuracy of the virtual road can be achieved for each curve segment or even each control point, rather than the entire curve. This does not need to rely on the fixed value of the tool's internal algorithm, and can improve the diversity and controllability of the virtual road performance.

[0095] The exemplary embodiment of the present disclosure also provides a virtual road generation device, referring to Figure 5 As shown, the virtual road generating device 500 may include the following program modules:

[0096] The control curve acquisition module 510 is used to acquire a road control curve, which is composed of a plurality of curve segments; each curve segment is respectively configured with a segment control parameter;

[0097] A model unit determination module 520, for determining a target road model unit corresponding to each curve segment from candidate road model units according to the segment control parameters corresponding to each curve segment, and adjusting the target road model unit corresponding to each curve segment;

[0098] The road model generation module 530 is used to splice the target road model units corresponding to each curve segment according to the position of each curve segment in the road control curve, so as to obtain a virtual road matching the road control curve.

[0099] In an optional implementation, based on the above-mentioned solution, after obtaining the road control curve, the virtual road generation device 500 may further include: a curve smoothing processing module, which is used to smooth each curve segment in the road control curve to obtain each adjusted curve segment.

[0100] In an optional embodiment, based on the above-mentioned scheme, the segment control parameters include road type parameters and road morphology parameters, and the model unit determination module 520 includes: a model unit matching module, which is used to determine the target road model unit corresponding to each curve segment from the candidate road model units according to the road type parameters corresponding to each curve segment; and a model unit adjustment module, which is used to adjust the target road model unit corresponding to each curve segment according to the road morphology parameters corresponding to each curve segment.

[0101] In an optional embodiment, based on the above-mentioned scheme, each curve segment is composed of at least two control points, each control point is respectively configured with a node control parameter, and the model unit adjustment module is also used to adjust the target road model unit corresponding to each curve segment according to the node control parameters corresponding to each control point.

[0102] In an optional implementation, based on the above solution, the model unit adjustment module is further used to obtain the overall control parameters defined for the road control curve, and adjust the target road model unit corresponding to each curve segment according to the overall control parameters.

[0103] In an optional embodiment, based on the above scheme, after obtaining the road control curve, the virtual road generation device 500 may also include: an angle judgment module, used to determine the curve intersection point between each curve segment, and judge whether the angle between the curve segments connected to the curve intersection point meets the preset conditions; an angle adjustment module, used to adjust the angle between the curve segments connected to the curve intersection point if not, so that the angle meets the preset conditions.

[0104] In an optional implementation, based on the above solution, the angle determination module may be configured to determine whether the angle between the curve segments connected to the curve intersection point belongs to a subset of a preset angle set.

[0105] In an optional embodiment, based on the aforementioned scheme, the angle adjustment module can be configured to: determine the angle difference between the curve segments connected to the curve intersection point and the angles in the preset angle set; determine the target angle from the preset angle set according to the angle difference; and adjust the angle between the curve segments connected to the curve intersection point according to the target angle.

[0106] In an optional implementation, based on the above-mentioned scheme, the curve intersection is configured with an intersection control parameter, and the model unit adjustment module is further used to adjust the target road model unit corresponding to the curve segment connected to the curve intersection according to the intersection control parameter.

[0107] In an optional embodiment, based on the aforementioned scheme, the model unit adjustment module can be configured to: scale the target road model unit corresponding to the curve segment connected to the curve intersection according to the width control parameter in the intersection control parameter; and / or rotate the target road model unit corresponding to the curve segment connected to the curve intersection according to the rotation control parameter in the intersection control parameter.

[0108] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0109] The exemplary embodiment of the present disclosure further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned virtual road generation method is implemented.

[0110] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0111] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0112] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0113] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on an electronic device, its code is used to enable the electronic device to execute (more specifically, the processor of the electronic device may execute) the method steps of various exemplary embodiments of the present disclosure. Exemplarily, the following steps may be included:

[0114] Obtaining a road control curve, the road control curve is composed of a plurality of curve segments; each curve segment is respectively configured with a segment control parameter;

[0115] According to the segment control parameters corresponding to each curve segment, a target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted;

[0116] According to the position of each curve segment in the road control curve, the target road model units corresponding to each curve segment are spliced ​​to obtain a virtual road matching the road control curve.

[0117] In an optional implementation, based on the above solution, after the road control curve is obtained, the following steps may be performed: smoothing each curve segment in the road control curve to obtain each adjusted curve segment.

[0118] In an optional embodiment, based on the above-mentioned scheme, the segmentation control parameters include road type parameters and road morphology parameters. According to the segmentation control parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted. This can be achieved by the following steps: according to the road type parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units; according to the road morphology parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is adjusted.

[0119] In an optional embodiment, based on the above-mentioned scheme, each curve segment is composed of at least two control points, each control point is respectively configured with a node control parameter, and the target road model unit corresponding to each curve segment is adjusted. It can also be achieved by the following steps: According to the node control parameters corresponding to each control point, the target road model unit corresponding to each curve segment is adjusted.

[0120] In an optional embodiment, based on the above-mentioned scheme, the target road model unit corresponding to each curve segment is adjusted, which can also be achieved by the following steps: obtaining the overall control parameters defined for the road control curve, and adjusting the target road model unit corresponding to each curve segment according to the overall control parameters.

[0121] In an optional embodiment, based on the above-mentioned scheme, after obtaining the road control curve, the following steps can also be performed: determine the curve intersection point between each curve segment, and judge whether the angle between the curve segments connected to the curve intersection point meets the preset conditions; if not, adjust the angle between the curve segments connected to the curve intersection point so that the angle meets the preset conditions.

[0122] In an optional implementation, based on the aforementioned scheme, determining whether the angle between the curve segments connected to the curve intersection point meets the preset conditions can be achieved through the following steps: determining whether the angle between the curve segments connected to the curve intersection point belongs to a subset of the preset angle set.

[0123] In an optional embodiment, based on the above-mentioned scheme, the angle between the curve segments connected to the curve intersection point is adjusted so that the angle meets the preset conditions, which can be achieved through the following steps: determining the angle difference between the angle between the curve segments connected to the curve intersection point and the angles in the preset angle set; determining the target angle from the preset angle set based on the angle difference; and adjusting the angle between the curve segments connected to the curve intersection point based on the target angle.

[0124] In an optional embodiment, based on the above-mentioned scheme, the curve intersection is configured with an intersection control parameter, and the target road model unit corresponding to each curve segment is adjusted. This can be achieved through the following steps: According to the intersection control parameter, the target road model unit corresponding to the curve segment connected to the curve intersection is adjusted.

[0125] In an optional embodiment, based on the above-mentioned scheme, the target road model unit corresponding to the curve segment connected to the curve intersection is adjusted according to the intersection control parameters, which can be achieved through the following steps: scaling the target road model unit corresponding to the curve segment connected to the curve intersection according to the width control parameters in the intersection control parameters; and / or rotating the target road model unit corresponding to the curve segment connected to the curve intersection according to the rotation control parameters in the intersection control parameters.

[0126] In the above steps, the road control curve is composed of multiple curve segments and each curve segment is respectively configured with segment control parameters, so that the user only needs to adjust the segment control parameters to meet various road production needs, which can enhance the controllability, flexibility and diversity of road model generation to a certain extent; through the segment control parameters corresponding to each curve segment in the road control curve, the corresponding road model component units are selected from the candidate road model units and spliced ​​after adjustment, without the need to start model production from scratch, which not only improves the generation efficiency of virtual roads but also ensures the generation quality of virtual roads, and can be better applied to game projects of larger sizes.

[0127] The exemplary embodiment of the present disclosure also provides an electronic device capable of implementing the above-mentioned virtual road generation method. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor executes the method in the exemplary embodiment by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.

[0128] Reference below Figure 6 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 6The electronic device 600 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0129] like Figure 6 As shown, the electronic device 600 may include: a processor 610 , a memory 620 , a bus 630 , an I / O (input / output) interface 640 , a network adapter 650 , and a display 660 .

[0130] The memory 620 may include a volatile memory, such as a RAM 621, a cache unit 622, and may also include a non-volatile memory, such as a ROM 623. The memory 620 may also include one or more program modules 624, such program modules 624 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 624 may include each module in the above-mentioned device.

[0131] The processor 610 may include one or more processing units. For example, the processor 610 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0132] The processor 610 may be configured to execute executable instructions stored in the memory 620 , such as executing any one or more method steps in this exemplary embodiment.

[0133] Exemplarily, the processor 610 may perform the following steps:

[0134] Obtaining a road control curve, where the road control curve is composed of a plurality of curve segments; each curve segment is respectively configured with a segment control parameter;

[0135] According to the segment control parameters corresponding to each curve segment, a target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted;

[0136] According to the position of each curve segment in the road control curve, the target road model units corresponding to each curve segment are spliced ​​to obtain a virtual road matching the road control curve.

[0137] In an optional implementation, based on the above solution, after the road control curve is obtained, the following steps may be performed: smoothing each curve segment in the road control curve to obtain each adjusted curve segment.

[0138] In an optional embodiment, based on the above-mentioned scheme, the segmentation control parameters include road type parameters and road morphology parameters. According to the segmentation control parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units, and the target road model unit corresponding to each curve segment is adjusted. This can be achieved by the following steps: according to the road type parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is determined from the candidate road model units; according to the road morphology parameters corresponding to each curve segment, the target road model unit corresponding to each curve segment is adjusted.

[0139] In an optional embodiment, based on the above-mentioned scheme, each curve segment is composed of at least two control points, each control point is respectively configured with a node control parameter, and the target road model unit corresponding to each curve segment is adjusted. It can also be achieved by the following steps: According to the node control parameters corresponding to each control point, the target road model unit corresponding to each curve segment is adjusted.

[0140] In an optional embodiment, based on the above-mentioned scheme, the target road model unit corresponding to each curve segment is adjusted, which can also be achieved by the following steps: obtaining the overall control parameters defined for the road control curve, and adjusting the target road model unit corresponding to each curve segment according to the overall control parameters.

[0141] In an optional embodiment, based on the above-mentioned scheme, after obtaining the road control curve, the following steps can also be performed: determine the curve intersection point between each curve segment, and judge whether the angle between the curve segments connected to the curve intersection point meets the preset conditions; if not, adjust the angle between the curve segments connected to the curve intersection point so that the angle meets the preset conditions.

[0142] In an optional implementation, based on the aforementioned scheme, determining whether the angle between the curve segments connected to the curve intersection point meets the preset conditions can be achieved through the following steps: determining whether the angle between the curve segments connected to the curve intersection point belongs to a subset of the preset angle set.

[0143] In an optional embodiment, based on the above-mentioned scheme, the angle between the curve segments connected to the curve intersection point is adjusted so that the angle meets the preset conditions, which can be achieved through the following steps: determining the angle difference between the angle between the curve segments connected to the curve intersection point and the angles in the preset angle set; determining the target angle from the preset angle set based on the angle difference; and adjusting the angle between the curve segments connected to the curve intersection point based on the target angle.

[0144] In an optional embodiment, based on the above-mentioned scheme, the curve intersection is configured with an intersection control parameter, and the target road model unit corresponding to each curve segment is adjusted. This can be achieved through the following steps: According to the intersection control parameter, the target road model unit corresponding to the curve segment connected to the curve intersection is adjusted.

[0145] In an optional embodiment, based on the above-mentioned scheme, the target road model unit corresponding to the curve segment connected to the curve intersection is adjusted according to the intersection control parameters, which can be achieved through the following steps: scaling the target road model unit corresponding to the curve segment connected to the curve intersection according to the width control parameters in the intersection control parameters; and / or rotating the target road model unit corresponding to the curve segment connected to the curve intersection according to the rotation control parameters in the intersection control parameters.

[0146] In the above steps, the road control curve is composed of multiple curve segments and each curve segment is respectively configured with segment control parameters, so that the user only needs to adjust the segment control parameters to meet various road production needs, which can enhance the controllability, flexibility and diversity of road model generation to a certain extent; through the segment control parameters corresponding to each curve segment in the road control curve, the corresponding road model component units are selected from the candidate road model units and spliced ​​after adjustment, without the need to start model production from scratch, which not only improves the generation efficiency of virtual roads but also ensures the generation quality of virtual roads, and can be better applied to game projects of larger sizes.

[0147] The bus 630 is used to realize the connection between different components of the electronic device 600, and may include a data bus, an address bus, and a control bus.

[0148] The electronic device 600 can communicate with one or more external devices 700 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 640 .

[0149] The electronic device 600 can communicate with one or more networks through the network adapter 650. For example, the network adapter 650 can provide mobile communication solutions such as 3G / 4G / 5G, or provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 650 can communicate with other modules of the electronic device 600 through the bus 630.

[0150] The electronic device 600 may display a graphical user interface and the like through the display 660 .

[0151] although Figure 6 Not shown, other hardware and / or software modules may also be provided in the electronic device 600, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID (Redundant Arrays of Independent Disks) system, a tape drive, and a data backup storage system.

[0152] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0153] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0154] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A virtual road generation method, characterized in that: The method comprises: Acquire a road control curve, wherein the road control curve is composed of a plurality of curve segments; each of the curve segments is respectively configured with a segment control parameter; According to the segment control parameters corresponding to each of the curve segments, a target road model unit corresponding to each of the curve segments is determined from the candidate road model units, and the target road model unit corresponding to each of the curve segments is adjusted; According to the position of each curve segment in the road control curve, the target road model units corresponding to each curve segment are spliced ​​to obtain a virtual road matching the road control curve.

2. The method according to claim 1, characterized in that After obtaining the road control curve, the method further includes: Smoothing is performed on each of the curve segments in the road control curve to obtain each of the adjusted curve segments.

3. The method according to claim 1, characterized in that: The segment control parameters include road type parameters and road shape parameters. According to the segment control parameters corresponding to each curve segment, a target road model unit corresponding to each curve segment is determined from candidate road model units, and the target road model unit corresponding to each curve segment is adjusted, including: Determining a target road model unit corresponding to each of the curve segments from candidate road model units according to the road type parameters corresponding to each of the curve segments; According to the road shape parameters corresponding to each of the curve segments, the target road model units corresponding to each of the curve segments are adjusted.

4. The method according to claim 1, characterized in that Each of the curve segments is composed of at least two control points, each of the control points is respectively configured with a node control parameter, and the adjusting of the target road model unit corresponding to each of the curve segments further includes: According to the node control parameters corresponding to the control points, the target road model units corresponding to the curve segments are adjusted.

5. The method according to claim 1, characterized in that The adjusting of the target road model units corresponding to each of the curve segments also includes: An overall control parameter defined for the road control curve is obtained, and a target road model unit corresponding to each curve segment is adjusted according to the overall control parameter.

6. The method according to claim 1, characterized in that After obtaining the road control curve, the method further includes: Determine a curve intersection point between each of the curve segments, and judge whether the angle between the curve segments connected to the curve intersection point meets a preset condition; If not, adjust the angle between the curve segments connected to the curve intersection point so that the angle meets the preset condition.

7. The method according to claim 6, characterized in that The determining whether the angle between the curve segments connected to the curve intersection point meets a preset condition includes: It is determined whether the angle between the curve segments connected to the curve intersection point belongs to a subset of the preset angle set.

8. The method according to claim 7, characterized in that The adjusting the angle between the curve segments connected to the curve intersection point so that the angle meets the preset condition includes: Determine the angle difference between the angles between the curve segments connected to the curve intersection point and the angles between the preset angle set; Determining a target angle from the preset angle set according to the angle difference; According to the target angle, the angle between the curve segments connected to the curve intersection point is adjusted.

9. The method according to claim 6, characterized in that The curve intersection point is configured with an intersection control parameter, and the target road model unit corresponding to each curve segment is adjusted, including: According to the intersection control parameter, the target road model unit corresponding to the curve segment connected to the curve intersection point is adjusted.

10. The method according to claim 9, characterized in that The step of adjusting the target road model unit corresponding to the curve segment connected to the curve intersection point according to the intersection control parameter includes: According to the width control parameter in the intersection control parameter, scaling the target road model unit corresponding to the curve segment connected to the curve intersection point; and / or According to the rotation control parameter in the intersection control parameter, the target road model unit corresponding to the curve segment connected to the curve intersection point is rotated.

11. A virtual road generation device, characterized in that: The device comprises: A control curve acquisition module is used to acquire a road control curve, wherein the road control curve is composed of a plurality of curve segments; each of the curve segments is respectively configured with a segment control parameter; A model unit determination module, used to determine the target road model unit corresponding to each curve segment from the candidate road model units according to the segment control parameters corresponding to each curve segment, and adjust the target road model unit corresponding to each curve segment; The road model generation module is used to splice the target road model units corresponding to each curve segment according to the position of each curve segment in the road control curve, so as to obtain a virtual road matching the road control curve.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 10 by executing the executable instructions.

Citation Information

Patent Citations

  • Modeling method of complex road

    CN102831261A

  • Model placement method and device

    CN111311745A

  • Road generation method and device for virtual scene

    CN114998538A

  • Track model generation method and device, computer equipment and storage medium

    CN117011452A

  • Dynamic model configuration method and device, terminal equipment and storage medium

    CN117379795A

Cited By

  • Road plane linetype dynamic linkage optimization method and device

    CN120562030A