Road model generation method, device and electronic equipment

CN117547829BActive Publication Date: 2026-10-16NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311363819.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2026-10-16
Estimated Expiration
2043-10-19

AI Technical Summary

Technical Problem

上述两种方式中,玩家创建的虚拟道路的形态需要受到所依托的游戏场景的地形的限制或受到所采用的道路编辑组件的形状的限制,玩家搭建的虚拟道路的丰富度较低,影响玩家的游戏体验

Benefits of technology

[0009] The aforementioned road model generation method, apparatus, and electronic device, in response to a road generation trigger operation, display a road model and multiple corresponding road editing components in a game editing scene to be edited. At least some of the multiple road editing components are located on the surface of the road model. The display form of the road model matches the initial pose parameters of the multiple road editing components. The display form indicates the curvature and torsion of the road model. In response to a pose adjustment operation for the road editing components, the current pose parameters of the road editing components are determined. Based on the current pose parameters of the multiple road editing components, the road model is updated. In this method, players can change the display form of the road model by adjusting the position and orientation of the road editing components, building virtual roads of various shapes according to their needs, thus enriching the player's gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117547829B_ABST
    Figure CN117547829B_ABST
Patent Text Reader

Abstract

The present application provides a kind of road model generation method, device and electronic equipment, in response to road generation trigger operation, display road model and multiple road editing components corresponding to road model in the game editing scene to be edited;Wherein, at least part of road editing component in multiple road editing components is located on the model surface of road model;The display form of road model matches the initial pose parameter of multiple road editing components;Display form is used to indicate the bending degree and the torsion degree of road model;In response to the pose adjustment operation for road editing component, determine the current pose parameter of road editing component;Based on the current pose parameter of multiple road editing components, update road model.In this way, player can change the display form of road model by adjusting the position and orientation of road editing component, and build virtual road with different forms according to demand, which enriches the game experience of player.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and more specifically, to a method, apparatus, and electronic device for generating road models. Background Technology

[0002] In some games, players can create virtual roads using game-provided components or virtual materials. Players can set virtual materials used in a specific area of ​​the virtual scene as road materials, or directly place road materials in an area to represent a virtual road. When the area is curved, the resulting virtual road is curved. When the game provides various road editing components, these components typically have different shapes. Players can combine different road editing components to generate the desired virtual road. However, in both of these methods, the shape of the virtual road created by the player is limited by the terrain of the game scene or the shape of the road editing components used. This results in a lower variety of virtual roads built by the player, negatively impacting the gaming experience. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide a road model generation method, apparatus and electronic device, so that players can build virtual roads of different shapes according to their needs, thus enriching the player's gaming experience.

[0004] In a first aspect, embodiments of the present invention provide a road model generation method, which provides a graphical user interface through a terminal device, displaying a game editing scene to be edited provided by a running game program in the graphical user interface. The method includes: in response to a road generation trigger operation, displaying a road model and a plurality of road editing components corresponding to the road model in the game editing scene to be edited; wherein at least some of the plurality of road editing components are located on the model surface of the road model; the display form of the road model is matched with the initial pose parameters of the plurality of road editing components; the display form is used to indicate the degree of curvature and torsion of the road model; in response to a pose adjustment operation for the road editing components, determining the current pose parameters of the road editing components; and updating the road model based on the current pose parameters of the plurality of road editing components.

[0005] Secondly, embodiments of the present invention provide a road model generation device, which provides a graphical user interface through a terminal device to display a game editing scene to be edited provided by a running game program. The device includes: a road editing component display module, used to display a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to a road generation trigger operation; wherein at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model matches the initial pose parameters of the multiple road editing components; the display form is used to indicate the curvature and torsion of the road model; a component pose adjustment module, used to determine the current pose parameters of the road editing components in response to a pose adjustment operation for the road editing components; and a road model update module, used to update the road model based on the current pose parameters of the multiple road editing components.

[0006] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the road model generation method described above.

[0007] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the aforementioned road model generation method.

[0008] The embodiments of the present invention bring the following beneficial effects:

[0009] The aforementioned road model generation method, apparatus, and electronic device, in response to a road generation trigger operation, display a road model and multiple corresponding road editing components in a game editing scene to be edited. At least some of the multiple road editing components are located on the surface of the road model. The display form of the road model matches the initial pose parameters of the multiple road editing components. The display form indicates the curvature and torsion of the road model. In response to a pose adjustment operation for the road editing components, the current pose parameters of the road editing components are determined. Based on the current pose parameters of the multiple road editing components, the road model is updated. In this method, players can change the display form of the road model by adjusting the position and orientation of the road editing components, building virtual roads of various shapes according to their needs, thus enriching the player's gaming experience.

[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in 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 the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a road model generation method provided in an embodiment of the present invention;

[0014] Figure 2 A schematic diagram of a road model provided in an embodiment of the present invention;

[0015] Figure 3 A schematic diagram of another road model provided in an embodiment of the present invention;

[0016] Figure 4 A schematic diagram of a spline curve provided in an embodiment of the present invention;

[0017] Figure 5 A schematic diagram of a spline curve corresponding to a normal control point provided in an embodiment of the present invention;

[0018] Figure 6 This is a schematic diagram of a spline curve corresponding to a width control point provided in an embodiment of the present invention;

[0019] Figure 7 A schematic diagram of the first model and the second model provided in the embodiments of the present invention;

[0020] Figure 8 A schematic diagram showing a first model and a second model displaying corresponding virtual positions, provided for embodiments of the present invention;

[0021] Figure 9 A graphical user interface diagram provided for an embodiment of the present invention;

[0022] Figure 10 This is a schematic diagram of another graphical user interface provided in an embodiment of the present invention;

[0023] Figure 11 This is a schematic diagram of another graphical user interface provided in an embodiment of the present invention;

[0024] Figure 12This is a schematic diagram illustrating the relationship between waypoint width and road width, provided as an embodiment of the present invention.

[0025] Figure 13 This is a schematic diagram of another graphical user interface provided in an embodiment of the present invention;

[0026] Figure 14 This is a schematic diagram of another graphical user interface provided in an embodiment of the present invention;

[0027] Figure 15 A schematic diagram of a road model with virtual waypoints provided in an embodiment of the present invention;

[0028] Figure 16 This is a schematic diagram of the structure of a road model generation device provided in an embodiment of the present invention;

[0029] Figure 17 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0031] In some games, players can create virtual roads using in-game components or virtual materials. In one game, players first build a basic road block and then use batch copy commands to create longer roads. However, this method of generating long roads by inputting commands has a high operational threshold, and the resulting road shapes are highly limited, only allowing for straight roads on a flat surface.

[0032] In a certain game, players assemble a long road model by combining multiple small road segments. This method takes a long time to assemble multiple basic models into a road, is inefficient, and cannot create a smooth, curved surface.

[0033] In a certain game, players can use a road tool to select two points on a plane to create a curved road. However, this method can only generate a surface facing the sky and cannot create complex, distorted curved surfaces.

[0034] Based on this, the present invention provides a road model generation method, apparatus and electronic device, which can be applied to various game scenarios that require the creation of virtual roads.

[0035] The road model generation method disclosed in one embodiment of the present invention can run on a local terminal device or a server. When the road model generation method runs on a server, it can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0036] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program's execution and the game screen presentation are separated. The storage and execution of the 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 information processing is performed by 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 screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0037] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0038] See Figure 1 First, a road model generation method provided by an embodiment of the present invention will be introduced. A graphical user interface is provided through a terminal device, displaying a game editing scene to be edited provided by a running game program. The method further includes the following steps:

[0039] Step S102: In response to the road generation trigger operation, a road model and multiple road editing components corresponding to the road model are displayed in the game editing scene to be edited; wherein, at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model is matched with the initial pose parameters of the multiple road editing components; the display form is used to indicate the degree of curvature and twist of the road model.

[0040] Step S104: In response to the pose adjustment operation for the road editing component, determine the current pose parameters of the road editing component.

[0041] Step S106: Update the road model based on the current pose parameters of multiple road editing components.

[0042] In the game, a road model can be pre-defined. The road model can be a closed 3D virtual model with only one face representing the road surface, which can be curved. Other faces connected to the road surface can be planes or curved surfaces, and they typically change as the road surface changes to create a smooth connection, thus forming a closed road model. For example... Figure 2 As shown, the curved surface represents the road surface, and the other surfaces are non-road surfaces. The road model described above can also be a curved surface model, directly representing the road with the surface of the curved surface model, without considering the road's thickness, the terrain it relies on, etc., such as... Figure 3 As shown.

[0043] The aforementioned road editing components can be directly created by the game system in response to player-defined touch operations. For example, a road generation control can be displayed in the graphical user interface. After the player triggers this control, a road model and corresponding road editing components can be displayed directly at a preset location in the game editing scene to be edited. Furthermore, the player can use the road generation control as the starting point for a sliding operation. By sliding the touch point to the area in the graphical user interface used to display the game editing scene to be edited, and then releasing the sliding operation at the first position, a preset number of road editing components can be created in the relevant area at that first position.

[0044] The aforementioned multiple road editing components can also be created sequentially in response to multiple commands generated by the player through certain touch operations. For example, the graphical user interface displays controls for controlling the creation of road editing components. The player can click on these controls and then click on a location in the area of ​​the graphical user interface that displays the game scene to be edited, thereby creating a road editing component in the scene location corresponding to that location. That is, the above road generation triggering operation can be one operation or multiple operations.

[0045] When creating a road editing component within a game editing scene displayed in a graphical user interface, initial pose parameters are typically already set for it. The pose usually refers to position and orientation, which can also be represented by direction. Correspondingly, the initial pose parameters include position and orientation parameters. The game editing scene is usually a three-dimensional virtual space. When a road editing component is created at a certain location within the game editing scene, the coordinates of that location in the corresponding spatial coordinate system of the game editing scene can be used as the position parameters of the road editing component. The initial orientation parameters of the road editing component can be pre-set, for example, all vertically upwards.

[0046] To represent the pose of the road editing component, it is typically an irregular shape. For example, the road editing component can be arrow-shaped, with the base of the arrow indicating its location and the direction it points in indicating its orientation. The specific shape can be set according to requirements, as long as it satisfies the display of the road editing component's position and orientation; there are no restrictions here.

[0047] Since a straight line can be established between two points, at least two road editing components need to be created for a road model. When at least two road editing components are created simultaneously, the corresponding road model can be generated based on these components, and the generated road model and road editing components are displayed together in the graphical user interface. When road editing components are created sequentially based on player actions, a road model needs to be generated after the second road editing component is created, based on the position and orientation of the first and second road editing components. When the player creates road editing components again in the game editing scene through certain operations, the corresponding road model needs to be generated based on all existing road editing components.

[0048] When generating a road model, the initial position and orientation parameters of multiple road editing components are required. After obtaining these parameters, the road direction parameters must first be determined based on them. These parameters indicate the direction of the road curve, which can be considered a three-dimensional curve that can bend along the X, Y, and Z axes in virtual space. This bending occurs when three or more adjacent road editing components cannot be aligned on a straight line. This road curve can be the center curve, a curve on one side of the road, or a curve at the lateral 1 / 3 of the road's length; the specific settings can be configured according to requirements and are not limited here.

[0049] Determining road alignment parameters can be simplified to the following mathematical problem: Based on the positions of points in multiple three-dimensional spaces, determine a smooth curve. This curve should pass through all points or be as close to all points as possible. This mathematical problem can usually be solved using interpolation algorithms. Interpolation refers to using known data to predict unknown data. In this case, the positions of the points in the three-dimensional space are the reference data, and the positional data are the other points on the curve. There are various interpolation algorithms, such as algebraic polynomial interpolation and spline interpolation. The specific algorithm can be selected according to the requirements, and no restrictions are imposed here.

[0050] The aforementioned road editing components typically have a specified order, indicating the order in which the corresponding road models pass through the components. These components are usually displayed in this specified order on the graphical user interface. This specified order can be the creation order or the order assigned by the game system when creating multiple road editing components simultaneously. When using the spline interpolation algorithm, the initial position parameters of the multiple road editing components need to be determined as the position parameters of the direction control positions. The order in which these position parameters are applied in the spline interpolation algorithm corresponds to the order of their respective road editing components. Then, based on the position parameters of the direction control positions and the spline interpolation principle, the first spline curve is generated.

[0051] Spline interpolation is used to obtain a smooth curve or surface given a set of discrete data points. Its principle is to construct a continuous function such that the function value at each data point equals the corresponding data value, and exhibits smoothness across intervals between adjacent data points. There are various spline interpolation methods, such as Bézier splines and B-splines. Different spline interpolation methods produce different spline curves. For example, when using B-splines, the generated spline curve may not pass through all control points, but it will at least pass through the first and last control points. The specific method can be selected based on requirements. Therefore, the first spline curve must at least pass through the positions of the first and last road editing components in the specified order. For example... Figure 4 As shown, when there are three control points, a corresponding spline curve is generated, represented by a dashed line. After obtaining the first spline curve, it can be sampled, and the position parameters of the multiple first sampling points obtained are determined as road alignment parameters. The number of sampling points can be determined based on the number of faces in the road model, or it can be set manually; no restriction is imposed here.

[0052] After determining the road alignment parameters, the road plane normal parameters can be determined based on the initial orientation parameters, initial position parameters, and road alignment parameters of multiple road editing components. The road plane normal parameters indicate the normal direction of the road plane. A normal is always perpendicular to a plane; in this method, the plane typically refers to the tangent line at the location of the road editing component in the road model. Once the road alignment parameters and road plane normal parameters are determined, the road model can be generated. At least a portion of the road model's surface matches the road alignment parameters and road plane normal parameters. This "at least a portion of the model surface" refers to the surface representing the road surface in the road model; when the road model is a curved surface model, this "at least a portion of the model surface" refers to the entire curved surface model.

[0053] When determining the road plane normal parameters, the initial orientation parameter of the road editing component can be directly set as the normal direction parameter corresponding to the location of the road editing component. Then, based on the initial position parameters and normal direction parameters of the road editing component, the position parameters of the normal control points are determined. Specifically, the position parameters of the normal control points need to be determined based on the initial position parameters, normal direction parameters, and preset length parameters of the road editing component. The direction of the line connecting the location of the road editing component and the normal control point should be consistent with the direction indicated by the normal direction parameter; the length of the line connecting the location of the road editing component and the normal control point should match the length parameter. For example... Figure 5 As shown, points A, B, and C represent the initial positions of the road editing component. The arrow directions from A, B, and C represent the orientation of the road editing component. A line segment of the preset length parameter is intercepted in the arrow direction corresponding to A to obtain point D. The same operation is performed on B and C to obtain points E and F. Points D, E, and F are the normal control points. Figure 5 In the diagram, AD, BE, and CF appear to be of different lengths due to display reasons, but they are actually the same length. Then, based on the position parameters of the normal control points and the spline interpolation principle, a second spline curve can be generated. The specific generation method is similar to that of the first spline curve mentioned above, and will not be elaborated upon here.

[0054] Furthermore, the road plane normal parameters can be determined based on the second spline curve and the road alignment parameters. When the road alignment parameters include the position parameters of multiple first sampling points on the road curve, for each or some of the first sampling points on the road curve, a second sampling point corresponding to the first sampling point can be determined from the second spline curve based on the position parameters of the first sampling point; the line connecting the second sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; specifically, the tangent of the road curve at the first sampling point can be determined first, then a plane centered on the first sampling point and perpendicular to the tangent can be established, and the intersection of the plane and the second spline curve can be determined as the second sampling point corresponding to the first sampling point. Furthermore, based on the position parameters of the first sampling point and the corresponding second sampling point, the direction parameter pointing from the first sampling point to the second sampling point can be determined, thereby determining the direction parameter as the road plane normal parameter corresponding to the first sampling point.

[0055] Furthermore, initial size parameters can be set for road editing components to further determine the display form of the road model. For example, when the road model includes a curved surface model, and the initial size parameters of different road editing components are different, it may be necessary to smooth the width of the road model. When creating the road model, the road width parameters can be determined using initial size parameters. Specifically, the spline interpolation principle mentioned above can be used, requiring the road width parameters to be determined based on the initial size parameters, initial position parameters, and road orientation parameters of the road editing components. More specifically, the position parameters of the road width control points can be determined based on the initial size parameters, initial position parameters, and initial orientation parameters of the road editing components.

[0056] Taking the road curve as the center curve of the road as an example, such as Figure 6 As shown, A and B represent the initial positions, and the arrows originating from A and B represent the initial orientation. The CD segment, representing the initial dimension, is perpendicular to its corresponding initial orientation with A as its midpoint, and the EF segment, representing the initial dimension, is perpendicular to its corresponding initial orientation with B as its midpoint. Points B and E, or C and F, can be used as road width control points. Based on the position parameters of the road width control points and the spline interpolation principle, a third spline curve is generated. Based on the third spline curve and the road orientation parameters, the road width parameters are determined. The specific generation method is similar to that of the first spline curve and will not be elaborated here.

[0057] When the aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve, a third sampling point corresponding to the first sampling point can be determined from the third spline curve based on the position parameters of the first sampling point on the road curve. The line connecting the third sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point. The method for determining the third sampling point is similar to that for determining the second sampling point, and will not be elaborated here. Furthermore, the relative distance between the first and third sampling points can be determined based on the position parameters of the first and corresponding third sampling points. Based on the relative distance between the first and third sampling points, the road width parameter corresponding to the first sampling point can be determined; typically, this relative distance is half the road width corresponding to the first sampling point. Figure 6 As shown, point M represents one of the sampling points, the dashed line represents the generated third spline curve, and N is the third sampling point corresponding to M. The distance between M and N is half the road width corresponding to point M.

[0058] When the graphical user interface displays a road model and its corresponding multiple road editing components, the display appearance of the road model can be changed by adjusting the pose parameters of the road editing components. To represent the current position and current orientation of the road editing components, the road editing components can be divided into a first part and a second part; the shapes of the first and second parts are usually different. For example, the first part, representing the current position, can be a cube, while the second part, representing the current orientation, can be an arrow connected to the first part.

[0059] When players change the position of the road editing component, they can touch the first part of the road editing component. The entire road editing component will then move according to the touch point of the first touch operation. The position parameter corresponding to the touch point can be determined as the current position parameter of the road editing component, or the current position parameter can be determined by obtaining the position of the moved road editing component.

[0060] When players change the orientation of the road editing component, they can touch the second part of the component. Based on the position of the touch point, the second part can be rotated around the first part. Based on the orientation of the rotated second part, the current orientation parameter of the road editing component is determined, indicating that the parameter representing the orientation of the second part is the current orientation parameter of the road editing component.

[0061] In an optional implementation, when the road editing component is small, or the graphical user interface is small, making it difficult for the player to precisely control touch operations on the first or second part, movement control controls and rotation control controls can be set in the graphical user interface. When the player triggers the movement control control, movement control of the road editing component is determined. The player can control the road editing component to move following the touch point position based on the touch operation, and determine the current position parameters of the road editing component based on the touch point position. Three-dimensional coordinate axis markers, such as the X-axis, Y-axis, and Z-axis, are displayed at the movement control component or the road editing component. The player can perform touch operations on the road editing component, for example, by triggering the coordinate axis markers to control the road editing component to move along the axis.

[0062] When the player triggers the movement control, movement control of the road editing component is confirmed. A 3D coordinate axis can also be displayed on the rotation control or the road editing component. The player controls the second part of the road editing component to rotate around the first part using touch operations such as swiping. An angle parameter can be used on the 3D coordinate axis to indicate the current orientation of the road editing component. Based on the touch point position, after the second part rotates around the first part, the current orientation parameter of the road editing component is determined based on the orientation of the rotated second part.

[0063] Typically, the position and orientation of road editing components are not adjusted simultaneously. When the position of a road editing component is adjusted, in response to the position parameter update event of the road editing component, the road orientation parameters of the road model are updated based on the current position parameters of multiple road editing components. Specifically, this can be done by regenerating a spline curve representing the road curve based on the current position parameters of the road editing component and the difference principle of splines, and then sampling the spline curve to obtain the updated road axis parameters.

[0064] As discussed above, the road plane normal parameters are also affected by the location of the road editing components. Therefore, it is necessary to update the road plane normal parameters of the road model based on the current orientation parameters, current position parameters, and updated road direction parameters of multiple road editing components. Generating the updated road plane normal parameters is similar to the method described above for determining the road plane normal parameters, and will not be elaborated upon here. Furthermore, an updated road model can be generated based on the updated road direction parameters and the updated road plane normal parameters.

[0065] When the orientation of the road editing component is adjusted, the direction of the road curves in the road model remains unaffected; therefore, only the road plane normal parameters of the road model need to be redefined. In response to the orientation parameter update event of the road editing component, the road plane normal parameters of the road model need to be updated based on the updated current orientation parameters, current position parameters, and road direction parameters of multiple road editing components. The specific implementation method has been discussed above and will not be repeated here. Furthermore, an updated road model can be generated based on the road direction parameters and the updated road plane normal parameters.

[0066] When updating the dimensional parameters of the road editing component, the road model needs to be updated based on the updated dimensional parameters of the road editing component. Specifically, the width parameters of the road model can be determined in the same way as described above, using the updated dimensional parameters to regenerate the corresponding dimension variation splines, and further determine the width parameters at each location. The specific method has been discussed above and will not be repeated here.

[0067] In addition, the width scaling ratio of the road model can be determined based on the size parameters of the updated road editing component and the size parameters before the update. This scaling ratio can vary based on the distance between each sampling point and the updated road editing component. For example, the width scaling ratio of the road surface closer to the road editing component is closer to the ratio of the size parameters before and after the update. Specifically, it can also be determined by sampling curve smoothing. Furthermore, the road model can be updated based on the width scaling ratio of each road location.

[0068] The aforementioned road model generation method, in response to a road generation trigger operation, displays a road model and multiple corresponding road editing components in the game editing scene to be edited. At least some of the multiple road editing components are located on the surface of the road model. The display form of the road model matches the initial pose parameters of the multiple road editing components. The display form indicates the curvature and torsion of the road model. In response to a pose adjustment operation for a road editing component, the current pose parameters of the road editing component are determined. Based on the current pose parameters of the multiple road editing components, the road model is updated. In this method, players can change the display form of the road model by adjusting the position and orientation of the road editing components, building virtual roads of various shapes according to their needs, thus enriching the player's gaming experience.

[0069] To enhance player control, players can also delete or add new road editing components. Players can delete a specific road editing component by long-pressing it or dragging it to a designated location, thus directly deleting the first component. The road model can then be updated based on the current pose parameters of the remaining road editing components (excluding the first component). The specific method is similar to that used to generate the road model and will not be elaborated upon here.

[0070] Players can also add road editing components through in-game actions, such as clicking the component addition control on the graphical user interface. Players can also select a road editing component by long-pressing or double-clicking. When selecting a second component out of multiple road editing components, the second component is designated as the target component. The graphical user interface then displays a control for adding the component; triggering this control results in the component addition operation. In response to the component addition operation, the new component is generated on the surface of the road model between the second component and a third component adjacent to the second component in a specified order. Specifically, this can be a road editing component before or after the second component, depending on requirements; this is not discussed here.

[0071] New components can be generated at a specific location on the road curve between the first and third components. The orientation of the new component aligns with the normal direction at that location, and its size matches the road width at that location. This means the new component will not affect the current display appearance of the road model. When a player adjusts the pose of a new component, the system responds by determining the new component's current pose parameters. Then, based on the current pose parameters of multiple road editing components and the new component, the road model is updated. The specific implementation has been discussed above and will not be repeated here. In practice, other settings for the position and orientation of the new component that might affect the display appearance of the road model are also possible and are not restricted here.

[0072] After generating a road model, players can trigger road generation actions to create new road models and multiple corresponding road editing components. At this point, the newly created road model and its corresponding road editing components will be displayed simultaneously in the game editing scene.

[0073] In the game editing scene, multiple road models can be displayed simultaneously. Typically, multiple road editing components are displayed for each road model, or only for the road model the player is currently adjusting. To facilitate the creation of road models of various shapes, players can select two or more road models to combine them.

[0074] The process of model splicing is explained using the player's selection of the first and second models as an example. The selection operation can be a long press, a tap, or opening the editing interface of the first model and selecting the corresponding splicing option. For example, the player can long press to select the first model. In response to this selection, splicing control controls are displayed in the graphical user interface. When the player triggers the splicing control controls, the system responds by setting the specified road editing components corresponding to the road models other than the first model to a selectable state. These specified road editing components are located at the end of the specified order; specifically, they can be highlighted or flashing. The player can select the specified road editing components corresponding to other road models. In response to the selection of the specified road editing components corresponding to the second model (excluding the first model), the system determines that the two models will be spliced, designating the first model as the first to be spliced ​​and the second model as the second to be spliced. The specific selection operations for multiple models can be configured according to needs and are not limited here.

[0075] Players can select the first and second models in a specific order. The first model will then be designated as the first to be stitched, and the second model as the second, corresponding to the selection order. The multiple road editing components corresponding to the road model are usually arranged in a specified order, corresponding to the road's direction. During the stitching process, the road models will be stitched end-to-end. For example, you can set it to stitch the first road editing component of the first model to be stitched together and the last road editing component of the second model to be stitched together. If you need to stitch the last road editing component of the first model together and the first road editing component of the second model together, you can change the selection order of the first and second models.

[0076] The multiple road editing components corresponding to the first model are arranged in a first specified order, such as Figure 7As shown, the model on the left represents the first model, with the arrowed circular markers A, B, and C indicating their corresponding road editing components, arranged in the order A, B, C. The model on the right represents the second model, with the arrowed circular markers D, E, and F indicating their corresponding road editing components, arranged in the order D, E, F. Then, based on the third component corresponding to the first model to be stitched and the fourth component corresponding to the second model to be stitched, the first and second models to be stitched can be stitched together to obtain the stitched road model. The third component is located in the first specified position in the first specified order, usually the first or last, i.e., component A or component C in the first model; the fourth component is located in the second specified position in the second specified order, usually the first or last, i.e., component D or component F in the second model.

[0077] When the third component is at the beginning of the first specified order, the fourth component is usually at the end of the second specified order. Stitching road models typically refers to creating connected sections within the road models. Target pose parameters can be determined based on the third component among multiple road editing components corresponding to the first model to be stitched and the fourth component among multiple road editing components corresponding to the second model to be stitched. Target pose parameters typically include target position parameters and target orientation parameters. Without considering the smoothness of the model connections, only the position parameters of the third and fourth components can be set to be the same. For example, the position parameters of the third component of the first model to be stitched can be determined as the target position parameters, based on the first model to be stitched. If a certain smoothness is desired in the stitched model, the position and orientation parameters of the third component of the first model to be stitched can be determined as the target pose parameters, based on the first model to be stitched. The method of using the first model to be stitched as the reference can be replaced by using the second model to be stitched as the reference, or by using the middle position of the first and second models as the reference, depending on the specific requirements. When different references are used, the target attitude parameters are usually different, but the basic idea is to make the positions or poses of the third and fourth components the same.

[0078] After determining the target pose parameters, the poses of the first model to be stitched and its corresponding multiple road editing components, or the second model to be stitched and its corresponding multiple road editing components, can be updated based on these parameters. Alternatively, the poses of both models and their corresponding road editing components can be updated simultaneously to ensure that the updated poses of the third and fourth components match the target pose parameters. The specific model to be stitched corresponds to the method used to determine the target pose parameters. For example, when determining the target pose parameters using the first model to be stitched as a reference, it is usually necessary to update the poses of the second model to be stitched and its corresponding multiple road editing components by moving and rotating them, so that the position and pose of the fourth component are the same as the third component. Similarly, if the second model to be stitched is used as a reference, the first model to be stitched needs to be moved and rotated. If neither the first nor the second model is used as a reference, then both models typically need to be moved and rotated.

[0079] After pose update, the first and second models to be stitched can be stitched together. Specifically, the combination of the first and second models can be directly used as the stitched road model. Alternatively, the connecting parts of the first and second models can be merged, making them a single model, which can then be used as the stitched road model.

[0080] When stitching the first and second models to be stitched together after pose updates, to make the stitched portion smoother, the poses of one or more road editing components adjacent to the third and fourth components used for stitching can be adjusted. In specific implementation, the target pose parameters corresponding to the fifth component adjacent to the fourth component can be determined based on the curvature parameters of the model surface where the third component is located in the first model to be stitched. Figure 8 Taking the first model (left side) and the second model (right side) as examples, the third component is component C, the fourth component is component D, and the fifth component is component E. Based on the curvature parameters of the surface of the model on which component C sits, a position M can be determined in the 3D controls corresponding to the game editing scene to be edited, where the extension of the first model can smoothly transition with component C. Figure 8 As shown, the orientation of this position can usually be determined by the curvature parameters of the model surface. This process involves calculating the position and angle of the 3D control, which can be done mathematically and will not be elaborated here. After determining the above position and orientation, the target pose parameters corresponding to the fifth component can be obtained based on the position coordinates in 3D space. Then, the pose of the fifth component is adjusted to match the corresponding target pose parameters. While adjusting the pose of the fifth component, the display form of the second model is also updated.

[0081] The pose adjustment of the sixth component adjacent to the third component in the first splicing model can also be performed in the same way. That is, based on the curvature parameters of the model surface where the fourth component is located in the second splicing model, the target pose parameters corresponding to the sixth component adjacent to the third component are determined, and the pose of the sixth component is controlled to match the corresponding target pose parameters. For example Figure 8 As shown, the determined location is point N, and the arrow centered on point N points in the direction corresponding to that location. Component B can be directly adjusted to point N, and its direction can be adjusted to match the direction of point N. This results in a smoothly transitioned, stitched road model.

[0082] This invention also provides another method for generating road models, which in... Figure 1 This method is implemented based on the method shown. Taking a road model as an example, multiple road editing components (also called "waypoint components," or simply "waypoints") are placed on the surface of the road model. When the player adjusts the position and orientation of the road editing components, the position of the model surface containing the road editing components moves accordingly, causing the connected model surfaces to bend. The position of the model surface containing the road editing components twists as its orientation changes, causing the connected model surfaces to twist as well, thus allowing real-time control of the bending and twisting degree of the surface model. This method is simple to operate, provides intuitive feedback, and the generated surface can be customized with rich variations to meet various personalized needs. Furthermore, it can provide a function to stitch multiple road models together, eliminating the need for cumbersome model stitching steps and offering high real-time generation efficiency.

[0083] The following is an illustrative description of the key technical aspects involved in this solution:

[0084] 1. Establish waypoints and generate surface models that pass through waypoints in real time.

[0085] The waypoints described above are located as points in three-dimensional space. A waypoint can be represented as a small sphere model with an arrow pointing in the direction of the arrow. The waypoint component is a fundamental control for generating surface models.

[0086] In generating a surface model, curves need to be generated based on the locations of waypoints. When using a sampling method, this curve can be called a spline. The spline typically passes through all waypoints. To make the spline transition smoothly, it can pass through only a subset of waypoints. This subset usually includes the first and last waypoints in the total number of waypoints.

[0087] Then, the width is expanded to both sides of the spline to form a surface model. The faces of the surface model are perpendicular to the direction of the arrows pointing to the waypoints, and this is the final generated model. In the game, due to factors such as player level, there may be restrictions on the number of pixels occupied by the surface model that a player can generate. In this case, occupancy values ​​can be used to represent the pixel restrictions. Simultaneously with road generation, the road generator provides the editor with information on the number of model faces and physical faces of the road. The editor uses this information to dynamically calculate the road's occupancy value data.

[0088] 2. Move the waypoints to control the position and orientation of the surface model.

[0089] 3. The direction of the arrow at the rotation point controls the orientation of the surface model and adjusts the degree of distortion of the surface model.

[0090] 4. Adjust the width of the waypoint to control the width of the waypoint surface.

[0091] In this method, multiple waypoints can be pre-set, and an initial surface model matching these waypoints can be generated. Specifically, three waypoints located on a straight line can be set, and the three waypoints usually face the same direction. In this case, the surface of the generated initial surface model is flat. After the player presses the custom surface displayed in the graphical user interface, performs a touch operation, and releases the touch operation at a certain location in the graphical user interface, the generated initial surface model and the multiple pre-set waypoints will be displayed at that location in the graphical user interface, such as... Figure 9 As shown. Based on this surface model, players can control the position of waypoints, rotate the direction of waypoint arrows, and control the direction and twisting shape of the surface in a three-dimensional virtual space.

[0092] When controlling the location of waypoints, you can click Figure 9 The movement control shown triggers the waypoint control mode to "move," thereby controlling the direction of the surface model. After triggering the movement control, the coordinate axes of the 3D control coordinate system can be displayed at the location of the currently controlled waypoint, such as... Figure 10 As shown, you can then control the waypoint to move along any coordinate axis. By controlling the movement of the waypoint in 3D space, you can control the orientation of the surface model in 3D space. To control the orientation of the waypoint, you can click... Figure 9 The rotation control shown triggers the waypoint control mode to "move," thereby controlling the rotation of the waypoint arrow and ultimately controlling the distortion shape of the surface model. After triggering the rotation control, an indicator for directional coordinates is displayed around the currently controlled waypoint; this can be a circle or something similar. Figure 11 As shown, it is a closed figure composed of three arcs.

[0093] In addition, the width value of the waypoint can be controlled, which controls the width of the surface corresponding to the location of the waypoint. A diagram illustrating the waypoint width and its corresponding surface width is shown below. Figure 12 As shown. In practical implementation, it is necessary to smoothly connect surface sections of different widths based on multiple surface widths.

[0094] When triggered as follows Figure 9 When using the advanced settings controls shown, the graphical user interface can display, for example, [the following]. Figure 13 The advanced settings window shown on the right allows you to edit the width of waypoints, thereby controlling the overall width of the surface. The width of the surface corresponding to a waypoint can be the waypoint's width multiplied by a specified coefficient. For example... Figure 13 As shown, this window also allows for operations such as adding and deleting waypoints. When the second waypoint is triggered, two controls, "Insert Above" and "Delete," are displayed to the left of the second waypoint. "Insert Above" is used to insert a new waypoint between the first and second waypoints, while "Delete" is used to delete the second waypoint.

[0095] When editing road models, the strategy of generating roads in real time by placing waypoints will slow down the road generation speed as the number of waypoints in the road increases. In addition, the road surface with a high number of waypoints will be more likely to appear in the player's field of view during runtime, causing the entire road to be rendered, which increases the client's performance consumption.

[0096] Therefore, during editing, the upper limit of waypoints corresponding to a road model can be limited. If players do have design requirements for long, continuous roads, a function to bridge (or "stitch together") multiple discrete road surfaces can be provided. When roads are bridged, all the position information of the two bridged roads will be input into the road generator, so that the waypoints of the combined discrete roads form a road surface.

[0097] Multiple road models can be displayed simultaneously in the game's editing scene. When the player opens the advanced settings page, a splicing control is typically configured there, such as... Figure 14 As shown. After clicking the splicing control, the "tail" (i.e., the last) waypoint of other road models is displayed in the scene, while other waypoints are displayed in gray, indicating that they are not selectable. When the player clicks on the "tail" waypoint of another road, the game system sets the parameters (coordinates, direction, width) of the "head" waypoint of the current road to be consistent with the "tail" waypoint of the clicked road.

[0098] To make the stitched road model smoother, the position and orientation of road points adjacent to the road points used for stitching can be changed simultaneously, such as... Figure 15As shown, this is equivalent to creating a virtual waypoint for a smooth transition in the extended portion of another spliced ​​surface model, for waypoints adjacent to the waypoints used for splicing. Figure 15 Virtual waypoints are represented in gray. The position and orientation parameters of adjacent waypoints can then be set to be the same as the pose parameters of the virtual waypoints, thus achieving a smooth transition.

[0099] This method adjusts the surface by modifying waypoints, reducing the dimensionality from three-dimensional to one-dimensional, thus lowering the barriers to understanding and operation. In practical applications, the automatic generation of the basic model significantly improves construction efficiency, and the richness of the surface design can be increased by adding more anchor points. Players can select textures for the surface model and use it as various objects such as roads, bridges, pipes, rainbows, walls, fences, and conveyor belts. In addition to providing the function of flattening splines, it can also provide the function of side railings for the road surface. The length, number of faces, and slope information of the side railings are configurable by the player. For example, when the slope is negative, the side railing flips downwards, enriching the player's gaming experience.

[0100] Once players have determined that the road model's shape meets their needs, the road data can be saved. Because the road data is generated by the player through the editor, and due to the uniqueness of each player's generation, the mesh and physics resources are not directly saved in the map file and uploaded to the server. Instead, information such as waypoint locations and road segment merging methods is recorded and dynamically loaded as the player plays. The advantage of this approach is reduced storage pressure on the road server and a smaller download size for players. The disadvantage is that downloads are required before entering the map.

[0101] For the above method embodiments, see Figure 16 The embodiment of the present invention shown provides a road model generation device, which provides a graphical user interface through a terminal device to display a game editing scene to be edited provided by a running game program. The device includes:

[0102] The road editing component display module 1402 is used to display a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to the road generation trigger operation; wherein, at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model is matched with the initial pose parameters of the multiple road editing components; the display form is used to indicate the degree of curvature and twist of the road model;

[0103] The component pose adjustment module 1404 is used to respond to the pose adjustment operation for the road editing component and determine the current pose parameters of the road editing component.

[0104] The road model update module 1406 is used to update the road model based on the current pose parameters of multiple road editing components.

[0105] The aforementioned road model generation device, in response to a road generation trigger operation, displays a road model and multiple corresponding road editing components in the game editing scene to be edited. At least some of the multiple road editing components are located on the surface of the road model. The display form of the road model matches the initial pose parameters of the multiple road editing components. The display form indicates the curvature and torsion of the road model. In response to a pose adjustment operation for the road editing components, the device determines the current pose parameters of the road editing components. Based on the current pose parameters of the multiple road editing components, the device updates the road model. In this method, players can change the display form of the road model by adjusting the position and orientation of the road editing components, building virtual roads of various shapes according to their needs, thus enriching the player's gaming experience.

[0106] The aforementioned initial pose parameters include initial position parameters and initial orientation parameters; the aforementioned device further includes a road model generation module, which is used to: acquire the initial position parameters and initial orientation parameters of multiple road editing components; determine road direction parameters based on the initial position parameters of the multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; determine road plane normal parameters based on the initial orientation parameters, initial position parameters, and road direction parameters of the multiple road editing components; the road plane normal parameters are used to indicate the normal direction of the road plane; generate a road model based on the road direction parameters and road plane normal parameters; at least a portion of the model surface of the road model matches the road direction parameters and road plane normal parameters.

[0107] The aforementioned road editing components are arranged in a specified order; the road model generation module is also used to: determine the initial position parameters of the multiple road editing components as the position parameters of the orientation control position; generate the first segment curve based on the position parameters of the orientation control position and the spline interpolation principle; the first segment curve passes through the positions of the first and last road editing components in the specified order; sample the first segment curve, and determine the position parameters of the multiple first sampling points obtained by sampling as the road orientation parameters.

[0108] The aforementioned road model generation module is also used to: determine the initial orientation parameter of the road editing component as the normal direction parameter corresponding to the location of the road editing component; determine the position parameters of the normal control point based on the initial position parameter and normal direction parameter of the road editing component; generate a second spline curve based on the position parameters of the normal control point and the spline interpolation principle; and determine the road plane normal parameters based on the second spline curve and the road orientation parameter.

[0109] The aforementioned road orientation parameters include the position parameters of multiple first sampling points on the road curve; the aforementioned road model generation module is also used to: for the first sampling point on the road curve, based on the position parameters of the first sampling point, determine the second sampling point corresponding to the first sampling point from the second spline curve; the line connecting the second sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; based on the position parameters of the first sampling point and the corresponding second sampling point, determine the direction parameter from the first sampling point to the second sampling point, and determine the direction parameter as the road plane normal parameter corresponding to the first sampling point.

[0110] The aforementioned road model generation module is also used to: determine the position parameters of the normal control points based on the initial position parameters, normal direction parameters, and preset length parameters of the road editing component; wherein, the direction of the line connecting the location of the road editing component and the normal control point is consistent with the direction indicated by the normal direction parameter; and the length of the line connecting the location of the road editing component and the normal control point matches the length parameter.

[0111] The aforementioned road editing component also has initial size parameters; the aforementioned road model generation module is also used to: determine road width parameters based on the initial size parameters of the road editing component; and generate a road model based on the road width parameters.

[0112] The aforementioned initial pose parameters include initial position parameters and initial orientation parameters; the road model generation module is also used to: determine the position parameters of the road width control points based on the initial size parameters, initial position parameters, and initial orientation parameters of the road editing component; generate a third spline curve based on the position parameters of the road width control points and the spline interpolation principle; and determine the road width parameters based on the third spline curve and the road orientation parameters.

[0113] The aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve; the aforementioned road model generation module is also used to: for the first sampling point on the road curve, based on the position parameters of the first sampling point, determine a third sampling point corresponding to the first sampling point from the third spline curve; the line connecting the third sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; based on the position parameters of the first sampling point and the corresponding third sampling point, determine the relative distance between the first sampling point and the third sampling point; based on the relative distance between the first sampling point and the third sampling point, determine the road width parameter corresponding to the first sampling point.

[0114] The aforementioned graphical user interface displays the road generation control; the road editing component display module is also used to: in response to a trigger operation on the road generation control, display the road model and the corresponding multiple road editing components in the game scene to be edited.

[0115] The aforementioned road editing component includes a first part and a second part, wherein the position information of the first part in the game scene to be edited is configured as the position parameter of the road editing component; and the orientation information of the second part in the game scene to be edited is configured as the orientation parameter of the road editing component.

[0116] The aforementioned road editing component includes a first part and a second part; the current pose parameters include current position parameters; the component pose adjustment module is also used to: respond to a first touch operation applied to the first part of the road editing component, control the road editing component to move following the touch point position of the first touch operation, and determine the current position parameters of the road editing component based on the touch point position.

[0117] The aforementioned current pose parameters include current orientation parameters; the component pose adjustment module is also used to: respond to a second touch operation applied to the second part of the road editing component, control the second part to rotate around the first part based on the touch point position of the second touch operation; and determine the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0118] The graphical user interface described above displays the movement control controls; the current pose parameters include the current position parameters; the component pose adjustment module is also used to: respond to a third touch operation applied to the road editing component, control the road editing component to move following the touch point position of the third touch operation, and determine the current position parameters of the road editing component based on the touch point position.

[0119] The graphical user interface described above displays rotation control controls; the current pose parameters include the current orientation parameters; the component pose adjustment module is also used to: respond to a fourth touch operation applied to the road editing component, and control the second part to rotate around the first part based on the touch point position of the fourth touch operation; and determine the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0120] The aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the road model update module is also used to: respond to the position parameter update event of the road editing component, update the road direction parameters of the road model based on the current position parameters of multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; update the road plane normal parameters of the road model based on the current orientation parameters, current position parameters, and updated road direction parameters of multiple road editing components; and generate an updated road model based on the updated road direction parameters and updated road plane normal parameters.

[0121] The aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the road model update module is also used to: respond to the orientation parameter update event of the road editing component, update the road plane normal parameters of the road model based on the updated current orientation parameters, current position parameters and road direction parameters of multiple road editing components; and generate an updated road model based on the road direction parameters and the updated road plane normal parameters.

[0122] The aforementioned road editing component also has size parameters; the size parameters are used to control the road width parameters of the road model; the aforementioned device further includes: a second road model updating module, used to respond to the update operation of the size parameters of the road editing component, and update the road model based on the updated size parameters of the road editing component.

[0123] The aforementioned second road model update module is also used to: determine the width scaling ratio of the road model based on the updated size parameters of the road editing component and the size parameters before the update; and update the road model based on the width scaling ratio.

[0124] The aforementioned apparatus further includes: a component deletion module, used to delete the first component in response to a deletion operation on a first component among multiple road editing components; and a third road model update module, used to update the road model based on the current pose parameters of the multiple road editing components other than the first component.

[0125] The aforementioned multiple road editing components are arranged in a specified order; the aforementioned device further includes: a target component determination module, used to determine the second component as the target component in response to a selection operation of the second component among the multiple road editing components; a component addition module, used to generate a new component on the model surface of a portion of the road model between the second component and a third component adjacent to the second component in the specified order in response to a component addition operation; a pose parameter determination module, used to determine the current pose parameters of the new component in response to a pose adjustment operation of the new component; and a fourth road model update module, used to update the road model based on the current pose parameters of the multiple road editing components and the new component.

[0126] The aforementioned device also includes a road model addition module, which responds to road generation triggering operations and displays the newly added road model and multiple road editing components corresponding to the newly added road model in the graphical user interface.

[0127] The aforementioned game editing scene displays multiple road models and multiple road editing components corresponding to the road models; the aforementioned device further includes: a model to be spliced ​​determination module, used to determine the first model as the first model to be spliced ​​and the second model as the second model to be spliced ​​in response to the selection operation of the first model and the second model among the multiple road models; the multiple road editing components corresponding to the first model are arranged in a first specified order; the multiple road editing components corresponding to the second model are arranged in a second specified order; a splicing module, used to splice the first model to be spliced ​​and the second model to be spliced ​​based on the third component among the multiple road editing components corresponding to the first model to be spliced ​​and the fourth component among the multiple road editing components corresponding to the second model to be spliced, to obtain the spliced ​​road model; the third component is located in the first specified position in the first specified order, and the fourth component is located in the second specified position in the second specified order.

[0128] The multiple road editing components corresponding to the aforementioned road models are arranged in a specified order; the module for determining the model to be spliced ​​is further configured to: respond to a selection operation for the first model among the multiple road models, display splicing control controls in the graphical user interface; respond to a trigger operation for the splicing control controls, set the specified road editing components corresponding to the road models other than the first model among the multiple road models to a selectable state; the specified road editing components are located at the end of the specified order; respond to a selection operation for the specified road editing components corresponding to the second model other than the first model among the multiple road models, determine the first model as the first model to be spliced, and determine the second model as the second model to be spliced.

[0129] The third component is located at the beginning of the first specified order, and the fourth component is located at the end of the second specified order. The stitching module is also used to: determine the target pose parameters based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched; based on the target pose parameters, control the updating of the poses of the first model to be stitched and its corresponding multiple road editing components and / or the second model to be stitched and its corresponding multiple road editing components, so that the poses of the updated third and fourth components match the target pose parameters; and perform stitching processing on the first model to be stitched and the second model to be stitched after the pose update.

[0130] The aforementioned stitching module is also used to: determine the target posture parameters corresponding to the fifth component based on the curvature parameters of the model surface where the third component is located in the first model to be stitched, and the relative position between the fifth component adjacent to the fourth component and the fourth component, and control the posture of the fifth component to be adjusted to match the corresponding target posture parameters; and determine the target posture parameters corresponding to the sixth component based on the curvature parameters of the model surface where the fourth component is located in the second model to be stitched, and the relative position between the sixth component adjacent to the third component and the third component, and control the posture of the sixth component to be adjusted to match the corresponding target posture parameters.

[0131] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the aforementioned road model generation method. Specifically:

[0132] In response to a road generation trigger operation, a road model and multiple road editing components corresponding to the road model are displayed in the game editing scene to be edited; wherein, at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model matches the initial pose parameters of the multiple road editing components; the display form is used to indicate the curvature and twisting degree of the road model; in response to a pose adjustment operation for the road editing components, the current pose parameters of the road editing components are determined; based on the current pose parameters of the multiple road editing components, the road model is updated.

[0133] In the above methods, players can change the display appearance of the road model by adjusting the position and orientation of the road editing component, and build virtual roads of different shapes according to their needs, thus enriching the player's gaming experience.

[0134] Optionally, the initial pose parameters mentioned above include initial position parameters and initial orientation parameters; the road model is generated in the following manner: obtaining the initial position parameters and initial orientation parameters of multiple road editing components; determining road direction parameters based on the initial position parameters of multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; determining road plane normal parameters based on the initial orientation parameters, initial position parameters, and road direction parameters of multiple road editing components; the road plane normal parameters are used to indicate the normal direction of the road plane; generating a road model based on the road direction parameters and road plane normal parameters; at least a portion of the model surface of the road model matches the road direction parameters and road plane normal parameters.

[0135] Optionally, the aforementioned multiple road editing components are arranged in a specified order; the step of determining the road alignment parameters based on the initial position parameters of the multiple road editing components includes: determining the initial position parameters of the multiple road editing components as the position parameters of the alignment control position; generating a first spline curve based on the position parameters of the alignment control position and the spline interpolation principle; the first spline curve passes through the positions of the first road editing component and the last road editing component in the specified order; sampling the first spline curve, and determining the position parameters of the multiple first sampling points obtained by sampling as the road alignment parameters.

[0136] Optionally, the step of determining the road plane normal parameters based on the initial orientation parameters, initial position parameters, and road direction parameters of multiple road editing components includes: determining the initial orientation parameters of the road editing components as the normal direction parameters corresponding to the location of the road editing components; determining the position parameters of the normal control points based on the initial position parameters and normal direction parameters of the road editing components; generating a second spline curve based on the position parameters of the normal control points and the spline interpolation principle; and determining the road plane normal parameters based on the second spline curve and the road direction parameters.

[0137] Optionally, the aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve; the step of determining the road plane normal parameters based on the second spline curve and the road alignment parameters includes: for the first sampling point on the road curve, determining a second sampling point corresponding to the first sampling point from the second spline curve based on the position parameters of the first sampling point; the line connecting the second sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; based on the position parameters of the first sampling point and the corresponding second sampling point, determining the direction parameter pointing from the first sampling point to the second sampling point, and determining the direction parameter as the road plane normal parameter corresponding to the first sampling point.

[0138] Optionally, the step of determining the position parameters of the normal control point based on the initial position parameters and normal direction parameters of the road editing component includes: determining the position parameters of the normal control point based on the initial position parameters, normal direction parameters, and preset length parameters of the road editing component; wherein, the direction of the line connecting the location of the road editing component and the normal control point is consistent with the direction indicated by the normal direction parameters; and the length of the line connecting the location of the road editing component and the normal control point matches the length parameters.

[0139] Optionally, the road editing component also has initial size parameters; the road model is generated by: determining the road width parameters based on the initial size parameters of the road editing component; and generating the road model based on the road width parameters.

[0140] Optionally, the initial pose parameters mentioned above include initial position parameters and initial orientation parameters; the step of generating a road model based on road width parameters includes: determining the position parameters of road width control points based on the initial size parameters and initial position parameters of the road editing component; generating a third spline curve based on the position parameters of the road width control points and the spline interpolation principle; determining the road width parameters based on the third spline curve and road direction parameters; the road direction parameters are used to indicate the direction of the road curve; the road direction parameters are determined based on the initial position parameters.

[0141] Optionally, the aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve; the step of determining the road width parameters based on the third spline curve and the road alignment parameters includes: for the first sampling point on the road curve, determining a third sampling point corresponding to the first sampling point from the third spline curve based on the position parameters of the first sampling point; the line connecting the third sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; determining the relative distance between the first sampling point and the third sampling point based on the position parameters of the first sampling point and the corresponding third sampling point; and determining the road width parameter corresponding to the first sampling point based on the relative distance between the first sampling point and the third sampling point.

[0142] Optionally, the above graphical user interface displays a road generation control; the step of displaying a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to a road generation trigger operation includes: displaying a road model and multiple road editing components corresponding to the road model in the game scene to be edited in response to a trigger operation on the road generation control.

[0143] Optionally, the road editing component includes a first part and a second part, wherein the position information of the first part in the game scene to be edited is configured as the position parameter of the road editing component; and the orientation information of the second part in the game scene to be edited is configured as the orientation parameter of the road editing component.

[0144] Optionally, the aforementioned current pose parameters include current position parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a first touch operation applied to a first part of the road editing component, controlling the road editing component to move following the touch point position of the first touch operation, and determining the current position parameters of the road editing component based on the position of the first part.

[0145] Optionally, the aforementioned current pose parameters include current orientation parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a second touch operation applied to the second part of the road editing component, controlling the second part to rotate around the first part based on the touch point position of the second touch operation; and determining the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0146] Optionally, the graphical user interface displays a motion control control; the current pose parameters include current position parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a trigger operation on the motion control control to determine to perform motion control on the road editing component; responding to a third touch operation applied to the road editing component to control the road editing component to move following the touch point position of the third touch operation, and determining the current position parameters of the road editing component based on the position of the road editing component.

[0147] Optionally, the graphical user interface displays a rotation control control; the current pose parameters include the current orientation parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a trigger operation on the rotation control control to determine to perform rotation control on the road editing component; responding to a fourth touch operation applied to the road editing component, controlling the second part to rotate around the first part based on the touch point position of the fourth touch operation; and determining the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0148] Optionally, the aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the step of updating the road model based on the current pose parameters of multiple road editing components includes: responding to the position parameter update event of the road editing components, updating the road direction parameters of the road model based on the current position parameters of the multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; updating the road plane normal parameters of the road model based on the current orientation parameters, current position parameters, and updated road direction parameters of the multiple road editing components; and generating an updated road model based on the updated road direction parameters and updated road plane normal parameters.

[0149] Optionally, the aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the step of updating the road model based on the current pose parameters of multiple road editing components includes: responding to the orientation parameter update event of the road editing components, updating the road plane normal parameters of the road model based on the updated current orientation parameters, current position parameters, and road direction parameters of the multiple road editing components; and generating an updated road model based on the road direction parameters and the updated road plane normal parameters.

[0150] Optionally, the road editing component also has size parameters; the size parameters are used to control the road width parameters of the road model; the method further includes: in response to an update operation on the size parameters of the road editing component, updating the road model based on the updated size parameters of the road editing component.

[0151] Optionally, the step of updating the road model based on the updated size parameters of the road editing component includes: determining the width scaling ratio of the road model based on the updated size parameters of the road editing component and the size parameters before the update; and updating the road model based on the width scaling ratio.

[0152] Optionally, the method further includes: deleting the first component in response to a deletion operation on the first component among multiple road editing components; and updating the road model based on the current pose parameters of the multiple road editing components other than the first component.

[0153] Optionally, the aforementioned multiple road editing components are arranged in a specified order; the method further includes: in response to a selection operation on a second component among the multiple road editing components, determining the second component as the target component; in response to a component addition operation, generating a new component on the model surface of a portion of the road model between the second component and a third component adjacent to the second component in the specified order; in response to a pose adjustment operation on the new component, determining the current pose parameters of the new component; and updating the road model based on the current pose parameters of the multiple road editing components and the new component.

[0154] Optionally, after the multiple road editing components corresponding to the aforementioned road model, the method further includes: in response to the road generation trigger operation, displaying the newly added road model and the multiple road editing components corresponding to the newly added road model in the graphical user interface.

[0155] Optionally, the above-mentioned game editing scene to be edited displays multiple road models and multiple road editing components corresponding to the road models; the above method further includes: in response to the selection operation of the first model and the second model among the multiple road models, determining the first model as the first model to be spliced ​​and determining the second model as the second model to be spliced; the multiple road editing components corresponding to the first model are arranged in a first specified order; the multiple road editing components corresponding to the second model are arranged in a second specified order; based on the third component among the multiple road editing components corresponding to the first model to be spliced ​​and the fourth component among the multiple road editing components corresponding to the second model to be spliced, splicing processing is performed on the first model to be spliced ​​and the second model to be spliced ​​to obtain the spliced ​​road model; the third component is located in the first specified position in the first specified order and the fourth component is located in the second specified position in the second specified order.

[0156] Optionally, the multiple road editing components corresponding to the aforementioned road models are arranged in a specified order; in response to the selection operation of the first model and the second model among the multiple road models, the step of determining the first model as the first model to be spliced ​​and the second model as the second model to be spliced ​​includes: in response to the selection operation of the first model among the multiple road models, displaying splicing control controls in the graphical user interface; in response to the trigger operation of the splicing control controls, setting the specified road editing component corresponding to the road model other than the first model among the multiple road models to a selectable state; the specified road editing component is located at the end of the specified order; in response to the selection operation of the specified road editing component corresponding to the second model other than the first model among the multiple road models, determining the first model as the first model to be spliced ​​and the second model as the second model to be spliced.

[0157] Optionally, the third component is located at the beginning of the first specified order, and the fourth component is located at the end of the second specified order. The step of stitching the first model to be stitched and the second model to be stitched based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched includes: determining target pose parameters based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched; controlling the updating of the poses of the first model to be stitched and its corresponding multiple road editing components and / or the second model to be stitched and its corresponding multiple road editing components based on the target pose parameters, so that the updated poses of the third and fourth components match the target pose parameters; and performing stitching processing on the first model to be stitched and the second model to be stitched after the pose update.

[0158] Optionally, the above steps for stitching the first and second models to be stitched after pose update include: determining the target pose parameters of the fifth component adjacent to the fourth component based on the curvature parameters of the model surface where the third component is located in the first model to be stitched, and controlling the pose of the fifth component to be adjusted to match the corresponding target pose parameters; determining the target pose parameters of the sixth component adjacent to the third component based on the curvature parameters of the model surface where the fourth component is located in the second model to be stitched, and controlling the pose of the sixth component to be adjusted to match the corresponding target pose parameters.

[0159] See Figure 17 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the road model generation method described above.

[0160] Furthermore, Figure 17 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0161] The memory 101 may include high-speed random access memory (RAM) or 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 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 17 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.

[0162] Processor 100 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 processor 100 or by instructions in software form. Processor 100 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0163] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-described road model generation method.

[0164] The present invention provides a road model generation method, apparatus, and electronic device, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. Specifically:

[0165] In response to a road generation trigger operation, a road model and multiple road editing components corresponding to the road model are displayed in the game editing scene to be edited; wherein, at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model matches the initial pose parameters of the multiple road editing components; the display form is used to indicate the curvature and twisting degree of the road model; in response to a pose adjustment operation for the road editing components, the current pose parameters of the road editing components are determined; based on the current pose parameters of the multiple road editing components, the road model is updated.

[0166] In the above methods, players can change the display appearance of the road model by adjusting the position and orientation of the road editing component, and build virtual roads of different shapes according to their needs, thus enriching the player's gaming experience.

[0167] Optionally, the initial pose parameters mentioned above include initial position parameters and initial orientation parameters; the road model is generated in the following manner: obtaining the initial position parameters and initial orientation parameters of multiple road editing components; determining road direction parameters based on the initial position parameters of multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; determining road plane normal parameters based on the initial orientation parameters, initial position parameters, and road direction parameters of multiple road editing components; the road plane normal parameters are used to indicate the normal direction of the road plane; generating a road model based on the road direction parameters and road plane normal parameters; at least a portion of the model surface of the road model matches the road direction parameters and road plane normal parameters.

[0168] Optionally, the aforementioned multiple road editing components are arranged in a specified order; the step of determining the road alignment parameters based on the initial position parameters of the multiple road editing components includes: determining the initial position parameters of the multiple road editing components as the position parameters of the alignment control position; generating a first spline curve based on the position parameters of the alignment control position and the spline interpolation principle; the first spline curve passes through the positions of the first road editing component and the last road editing component in the specified order; sampling the first spline curve, and determining the position parameters of the multiple first sampling points obtained by sampling as the road alignment parameters.

[0169] Optionally, the step of determining the road plane normal parameters based on the initial orientation parameters, initial position parameters, and road direction parameters of multiple road editing components includes: determining the initial orientation parameters of the road editing components as the normal direction parameters corresponding to the location of the road editing components; determining the position parameters of the normal control points based on the initial position parameters and normal direction parameters of the road editing components; generating a second spline curve based on the position parameters of the normal control points and the spline interpolation principle; and determining the road plane normal parameters based on the second spline curve and the road direction parameters.

[0170] Optionally, the aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve; the step of determining the road plane normal parameters based on the second spline curve and the road alignment parameters includes: for the first sampling point on the road curve, determining a second sampling point corresponding to the first sampling point from the second spline curve based on the position parameters of the first sampling point; the line connecting the second sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; based on the position parameters of the first sampling point and the corresponding second sampling point, determining the direction parameter pointing from the first sampling point to the second sampling point, and determining the direction parameter as the road plane normal parameter corresponding to the first sampling point.

[0171] Optionally, the step of determining the position parameters of the normal control point based on the initial position parameters and normal direction parameters of the road editing component includes: determining the position parameters of the normal control point based on the initial position parameters, normal direction parameters, and preset length parameters of the road editing component; wherein, the direction of the line connecting the location of the road editing component and the normal control point is consistent with the direction indicated by the normal direction parameters; and the length of the line connecting the location of the road editing component and the normal control point matches the length parameters.

[0172] Optionally, the road editing component also has initial size parameters; the road model is generated by: determining the road width parameters based on the initial size parameters of the road editing component; and generating the road model based on the road width parameters.

[0173] Optionally, the initial pose parameters mentioned above include initial position parameters and initial orientation parameters; the step of generating a road model based on road width parameters includes: determining the position parameters of road width control points based on the initial size parameters and initial position parameters of the road editing component; generating a third spline curve based on the position parameters of the road width control points and the spline interpolation principle; determining the road width parameters based on the third spline curve and road direction parameters; the road direction parameters are used to indicate the direction of the road curve; the road direction parameters are determined based on the initial position parameters.

[0174] Optionally, the aforementioned road alignment parameters include the position parameters of multiple first sampling points on the road curve; the step of determining the road width parameters based on the third spline curve and the road alignment parameters includes: for the first sampling point on the road curve, determining a third sampling point corresponding to the first sampling point from the third spline curve based on the position parameters of the first sampling point; the line connecting the third sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; determining the relative distance between the first sampling point and the third sampling point based on the position parameters of the first sampling point and the corresponding third sampling point; and determining the road width parameter corresponding to the first sampling point based on the relative distance between the first sampling point and the third sampling point.

[0175] Optionally, the above graphical user interface displays a road generation control; the step of displaying a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to a road generation trigger operation includes: displaying a road model and multiple road editing components corresponding to the road model in the game scene to be edited in response to a trigger operation on the road generation control.

[0176] Optionally, the road editing component includes a first part and a second part, wherein the position information of the first part in the game scene to be edited is configured as the position parameter of the road editing component; and the orientation information of the second part in the game scene to be edited is configured as the orientation parameter of the road editing component.

[0177] Optionally, the aforementioned current pose parameters include current position parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a first touch operation applied to a first part of the road editing component, controlling the road editing component to move following the touch point position of the first touch operation, and determining the current position parameters of the road editing component based on the position of the first part.

[0178] Optionally, the aforementioned current pose parameters include current orientation parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a second touch operation applied to the second part of the road editing component, controlling the second part to rotate around the first part based on the touch point position of the second touch operation; and determining the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0179] Optionally, the graphical user interface displays a motion control control; the current pose parameters include current position parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a trigger operation on the motion control control to determine to perform motion control on the road editing component; responding to a third touch operation applied to the road editing component to control the road editing component to move following the touch point position of the third touch operation, and determining the current position parameters of the road editing component based on the position of the road editing component.

[0180] Optionally, the graphical user interface displays a rotation control control; the current pose parameters include the current orientation parameters; the step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: responding to a trigger operation on the rotation control control to determine to perform rotation control on the road editing component; responding to a fourth touch operation applied to the road editing component, controlling the second part to rotate around the first part based on the touch point position of the fourth touch operation; and determining the current orientation parameters of the road editing component based on the orientation of the rotated second part.

[0181] Optionally, the aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the step of updating the road model based on the current pose parameters of multiple road editing components includes: responding to the position parameter update event of the road editing components, updating the road direction parameters of the road model based on the current position parameters of the multiple road editing components; the road direction parameters are used to indicate the direction of the road curve; updating the road plane normal parameters of the road model based on the current orientation parameters, current position parameters, and updated road direction parameters of the multiple road editing components; and generating an updated road model based on the updated road direction parameters and updated road plane normal parameters.

[0182] Optionally, the aforementioned current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; the road plane normal parameters are used to indicate the normal direction of the road plane; the step of updating the road model based on the current pose parameters of multiple road editing components includes: responding to the orientation parameter update event of the road editing components, updating the road plane normal parameters of the road model based on the updated current orientation parameters, current position parameters, and road direction parameters of the multiple road editing components; and generating an updated road model based on the road direction parameters and the updated road plane normal parameters.

[0183] Optionally, the road editing component also has size parameters; the size parameters are used to control the road width parameters of the road model; the method further includes: in response to an update operation on the size parameters of the road editing component, updating the road model based on the updated size parameters of the road editing component.

[0184] Optionally, the step of updating the road model based on the updated size parameters of the road editing component includes: determining the width scaling ratio of the road model based on the updated size parameters of the road editing component and the size parameters before the update; and updating the road model based on the width scaling ratio.

[0185] Optionally, the method further includes: deleting the first component in response to a deletion operation on the first component among multiple road editing components; and updating the road model based on the current pose parameters of the multiple road editing components other than the first component.

[0186] Optionally, the aforementioned multiple road editing components are arranged in a specified order; the method further includes: in response to a selection operation on a second component among the multiple road editing components, determining the second component as the target component; in response to a component addition operation, generating a new component on the model surface of a portion of the road model between the second component and a third component adjacent to the second component in the specified order; in response to a pose adjustment operation on the new component, determining the current pose parameters of the new component; and updating the road model based on the current pose parameters of the multiple road editing components and the new component.

[0187] Optionally, after the multiple road editing components corresponding to the aforementioned road model, the method further includes: in response to the road generation trigger operation, displaying the newly added road model and the multiple road editing components corresponding to the newly added road model in the graphical user interface.

[0188] Optionally, the above-mentioned game editing scene to be edited displays multiple road models and multiple road editing components corresponding to the road models; the above method further includes: in response to the selection operation of the first model and the second model among the multiple road models, determining the first model as the first model to be spliced ​​and determining the second model as the second model to be spliced; the multiple road editing components corresponding to the first model are arranged in a first specified order; the multiple road editing components corresponding to the second model are arranged in a second specified order; based on the third component among the multiple road editing components corresponding to the first model to be spliced ​​and the fourth component among the multiple road editing components corresponding to the second model to be spliced, splicing processing is performed on the first model to be spliced ​​and the second model to be spliced ​​to obtain the spliced ​​road model; the third component is located in the first specified position in the first specified order and the fourth component is located in the second specified position in the second specified order.

[0189] Optionally, the multiple road editing components corresponding to the aforementioned road models are arranged in a specified order; in response to the selection operation of the first model and the second model among the multiple road models, the step of determining the first model as the first model to be spliced ​​and the second model as the second model to be spliced ​​includes: in response to the selection operation of the first model among the multiple road models, displaying splicing control controls in the graphical user interface; in response to the trigger operation of the splicing control controls, setting the specified road editing component corresponding to the road model other than the first model among the multiple road models to a selectable state; the specified road editing component is located at the end of the specified order; in response to the selection operation of the specified road editing component corresponding to the second model other than the first model among the multiple road models, determining the first model as the first model to be spliced ​​and the second model as the second model to be spliced.

[0190] Optionally, the third component is located at the beginning of the first specified order, and the fourth component is located at the end of the second specified order. The step of stitching the first model to be stitched and the second model to be stitched based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched includes: determining target pose parameters based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched; controlling the updating of the poses of the first model to be stitched and its corresponding multiple road editing components and / or the second model to be stitched and its corresponding multiple road editing components based on the target pose parameters, so that the updated poses of the third and fourth components match the target pose parameters; and performing stitching processing on the first model to be stitched and the second model to be stitched after the pose update.

[0191] Optionally, the above steps for stitching the first and second models to be stitched after pose update include: determining the target pose parameters of the fifth component adjacent to the fourth component based on the curvature parameters of the model surface where the third component is located in the first model to be stitched, and controlling the pose of the fifth component to be adjusted to match the corresponding target pose parameters; determining the target pose parameters of the sixth component adjacent to the third component based on the curvature parameters of the model surface where the fourth component is located in the second model to be stitched, and controlling the pose of the sixth component to be adjusted to match the corresponding target pose parameters.

[0192] See Figure 17 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the road model generation method described above.

[0193] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0194] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0195] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part 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 the present invention. 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.

[0196] In the description of this invention, 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. They are used only for the convenience of describing the invention and for 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. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0197] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention 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 within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these 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 the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating road models, characterized in that, The method includes providing a graphical user interface (GUI) via a terminal device, displaying a game editing scene to be edited provided by a running game program within the GUI, the method comprising: In response to a road generation trigger operation, a road model and multiple road editing components corresponding to the road model are displayed in the game editing scene to be edited; wherein, at least some of the multiple road editing components are located on the model surface of the road model; the display form of the road model is matched with the initial pose parameters of the multiple road editing components; the display form is used to indicate the degree of curvature and twist of the road model; In response to a pose adjustment operation on the road editing component, determine the current pose parameters of the road editing component; The road model is updated based on the current pose parameters of the multiple road editing components; pose refers to position and orientation.

2. The method according to claim 1, characterized in that, The initial pose parameters include initial position parameters and initial orientation parameters; The road model is generated in the following way: Obtain the initial position parameters and initial orientation parameters of the plurality of road editing components; Based on the initial position parameters of the plurality of road editing components, road direction parameters are determined; the road direction parameters are used to indicate the direction of the road curve. Based on the initial orientation parameters of the plurality of road editing components, the initial position parameters, and the road direction parameters, the road plane normal parameters are determined; the road plane normal parameters are used to indicate the normal direction of the road plane. A road model is generated based on the road orientation parameters and the road plane normal parameters; at least a portion of the model surface of the road model matches the road orientation parameters and the road plane normal parameters.

3. The method according to claim 2, characterized in that, The multiple road editing components are arranged in a specified order; The step of determining road direction parameters based on the initial position parameters of the multiple road editing components includes: The initial position parameters of the plurality of road editing components are determined as the position parameters of the direction control position; Based on the location parameters of the direction control position and the spline interpolation principle, a first spline curve is generated; the first spline curve passes through the locations of the first and last road editing components in the specified order. The first spline curve is sampled, and the position parameters of the multiple first sampling points obtained by sampling are determined as the road direction parameters.

4. The method according to claim 2, characterized in that, The step of determining the road plane normal parameters based on the initial orientation parameters of the plurality of road editing components, the initial position parameters, and the road direction parameters includes: The initial orientation parameter of the road editing component is determined as the normal direction parameter corresponding to the location of the road editing component; Based on the initial position parameters of the road editing component and the normal direction parameters, the position parameters of the normal control points are determined; Based on the position parameters of the normal control points and the spline interpolation principle, a second spline curve is generated; Based on the second spline curve and the road orientation parameters, the road plane normal parameters are determined.

5. The method according to claim 4, characterized in that, The road alignment parameters include the position parameters of multiple first sampling points on the road curve; The steps for determining the road plane normal parameters based on the second spline curve and the road orientation parameters include: For a first sampling point on the road curve, based on the position parameters of the first sampling point, a second sampling point corresponding to the first sampling point is determined from the second spline curve; the line connecting the second sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point; Based on the position parameters of the first sampling point and the corresponding second sampling point, the direction parameter pointing from the first sampling point to the second sampling point is determined, and the direction parameter is determined as the road plane normal parameter corresponding to the first sampling point.

6. The method according to claim 4, characterized in that, The step of determining the position parameters of the normal control point based on the initial position parameters of the road editing component and the normal direction parameters includes: Based on the initial position parameters of the road editing component, the normal direction parameters, and the preset length parameters, the position parameters of the normal control points are determined; Specifically, the direction of the line connecting the location of the road editing component and the normal control point is consistent with the direction indicated by the normal direction parameter; the length of the line connecting the location of the road editing component and the normal control point matches the length parameter.

7. The method according to claim 1, characterized in that, The road editing component also has initial size parameters; The road model is generated in the following way: Based on the initial size parameters of the road editing component, determine the road width parameters; A road model is generated based on the road width parameter.

8. The method according to claim 7, characterized in that, The initial pose parameters include initial position parameters and initial orientation parameters; The steps for generating a road model based on the road width parameters include: Based on the initial size parameters and initial position parameters of the road editing component, the position parameters of the road width control point are determined; Based on the location parameters of the road width control points and the spline interpolation principle, a third spline curve is generated; Based on the third spline curve and the road orientation parameters, the road width parameters are determined; the road orientation parameters are used to indicate the orientation of the road curve; the road orientation parameters are determined based on the initial position parameters.

9. The method according to claim 8, characterized in that, The road alignment parameters include the position parameters of multiple first sampling points on the road curve; The steps for determining the road width parameters based on the third spline curve and the road orientation parameters include: For a first sampling point on the road curve, a third sampling point corresponding to the first sampling point is determined from the third spline curve based on the position parameters of the first sampling point; the line connecting the third sampling point and the first sampling point is perpendicular to the tangent of the road curve at the first sampling point. Based on the position parameters of the first sampling point and the corresponding third sampling point, the relative distance between the first sampling point and the third sampling point is determined; Based on the relative distance between the first sampling point and the third sampling point, the road width parameter corresponding to the first sampling point is determined.

10. The method according to claim 1, characterized in that, The graphical user interface displays road generation controls; The steps of displaying a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to a road generation trigger operation include: In response to a trigger operation on the road generation control, the road model and its corresponding multiple road editing components are displayed in the game editing scene to be edited.

11. The method of claim 1, wherein the road editing component comprises a first part and a second part, wherein, The first part is configured as the position information of the road editing component in the game editing scene to be edited; the second part is configured as the orientation information of the road editing component in the game editing scene to be edited.

12. The method according to claim 11, characterized in that, The current pose parameters include the current position parameters; The step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: In response to a first touch operation applied to a first part of the road editing component, the road editing component is controlled to move following the touch point position of the first touch operation, and the current position parameters of the road editing component are determined based on the position of the first part.

13. The method according to claim 11, characterized in that, The current pose parameters include the current orientation parameters; The step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: In response to a second touch operation applied to the second part of the road editing component, the second part is controlled to rotate around the first part based on the touch point position of the second touch operation; Based on the orientation of the second part after rotation, the current orientation parameter of the road editing component is determined.

14. The method according to claim 1, characterized in that, The graphical user interface displays movement control controls; the current pose parameter includes the current position parameter. The step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: In response to a trigger operation on the movement control control, it is determined that movement control will be applied to the road editing component; In response to a third touch operation applied to the road editing component, the road editing component is controlled to move following the touch point position of the third touch operation, and the current position parameters of the road editing component are determined based on the position of the road editing component.

15. The method according to claim 11, characterized in that, The graphical user interface displays rotation control controls; the current pose parameters include the current orientation parameter. The step of determining the current pose parameters of the road editing component in response to a pose adjustment operation on the road editing component includes: In response to a trigger operation on the rotation control control, it is determined that rotation control will be applied to the road editing component; In response to a fourth touch operation applied to the road editing component, the second part is controlled to rotate around the first part based on the touch point position of the fourth touch operation; Based on the orientation of the second part after rotation, the current orientation parameter of the road editing component is determined.

16. The method according to claim 1, characterized in that, The current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; The road plane normal parameters are used to indicate the normal direction of the road plane; The step of updating the road model based on the current pose parameters of the plurality of road editing components includes: In response to the location parameter update event of the road editing component, the road orientation parameters of the road model are updated based on the current location parameters of the plurality of road editing components; Based on the current orientation parameters of the multiple road editing components, the current position parameters, and the updated road direction parameters, the road plane normal parameters of the road model are updated; An updated road model is generated based on the updated road orientation parameters and the updated road plane normal parameters.

17. The method according to claim 1, characterized in that, The current pose parameters include current position parameters and current orientation parameters; the road model is generated based on road direction parameters and road plane normal parameters; the road direction parameters are used to indicate the direction of the road curve; The road plane normal parameters are used to indicate the normal direction of the road plane; The step of updating the road model based on the current pose parameters of the plurality of road editing components includes: In response to the orientation parameter update event of the road editing component, the road plane normal parameters of the road model are updated based on the updated current orientation parameters of the plurality of road editing components, the current position parameters, and the road direction parameters; An updated road model is generated based on the road orientation parameters and the updated road plane normal parameters.

18. The method according to claim 1, characterized in that, The road editing component also has size parameters; these size parameters are used to control the road width parameters of the road model. The method further includes: In response to an update operation on the size parameters of the road editing component, the road model is updated based on the updated size parameters of the road editing component.

19. The method according to claim 18, characterized in that, The step of updating the road model based on the updated size parameters of the road editing component includes: Based on the updated and original dimensions of the road editing component, the width scaling ratio of the road model is determined. The road model is updated based on the width scaling ratio.

20. The method according to claim 1, characterized in that, The method further includes: In response to a deletion operation targeting a first component among the plurality of road editing components, the first component is deleted; The road model is updated based on the current pose parameters of multiple road editing components other than the first component.

21. The method according to claim 1, characterized in that, The multiple road editing components are arranged in a specified order; The method further includes: In response to a selection operation on the second component among the plurality of road editing components, the second component is identified as the target component; In response to a component addition operation, a new component is generated on the model surface of a portion of the road model between the second component and a third component adjacent to the second component in the specified order; In response to a pose adjustment operation for the newly added component, determine the current pose parameters of the newly added component; The road model is updated based on the current pose parameters of the multiple road editing components and the newly added component.

22. The method according to claim 1, characterized in that, In response to a road generation trigger operation, after displaying a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited, the method further includes: In response to the road generation trigger operation, the graphical user interface also displays the newly added road model and multiple road editing components corresponding to the newly added road model.

23. The method according to claim 22, characterized in that, The game editing scene to be edited displays multiple road models and multiple road editing components corresponding to the road models; The method further includes: In response to the selection operation of the first model and the second model among the plurality of road models, the first model is determined as the first model to be spliced, and the second model is determined as the second model to be spliced; the plurality of road editing components corresponding to the first model are arranged in a first specified order; the plurality of road editing components corresponding to the second model are arranged in a second specified order. Based on the third component among the multiple road editing components corresponding to the first model to be spliced ​​and the fourth component among the multiple road editing components corresponding to the second model to be spliced, the first model to be spliced ​​and the second model to be spliced ​​are spliced ​​to obtain the spliced ​​road model. The third component is located at the first specified position in the first specified order, and the fourth component is located at the second specified position in the second specified order.

24. The method according to claim 23, characterized in that, The multiple road editing components corresponding to the road model are arranged in a specified order; In response to a selection operation of a first model and a second model among the plurality of road models, the step of determining the first model as the first model to be stitched and the second model as the second model to be stitched includes: In response to a selection operation of the first model among the plurality of road models, a splicing control is displayed in the graphical user interface; In response to a trigger operation on the splicing control control, the designated road editing component corresponding to the road model other than the first model among the plurality of road models is set to a selectable state; the designated road editing component is located at the end of the designated order; In response to the selection operation of the specified road editing component corresponding to the second model (excluding the first model) among the plurality of road models, the first model is determined as the first model to be spliced, and the second model is determined as the second model to be spliced.

25. The method according to claim 23, characterized in that, The third component is located at the first position in the first specified order, and the fourth component is located at the last position in the second specified order; The steps for splicing the first model to be spliced ​​and the second model to be spliced ​​based on the third component of the multiple road editing components corresponding to the first model to be spliced ​​and the fourth component of the multiple road editing components corresponding to the second model to be spliced ​​include: Based on the third component among the multiple road editing components corresponding to the first model to be stitched and the fourth component among the multiple road editing components corresponding to the second model to be stitched, the target pose parameters are determined; Based on the target pose parameters, the poses of the first model to be stitched and its corresponding multiple road editing components and / or the second model to be stitched and its corresponding multiple road editing components are updated to match the updated poses of the third and fourth components with the target pose parameters. The first and second models to be stitched together are stitched together after the pose update.

26. The method according to claim 25, characterized in that, The steps for stitching the first and second models to be stitched together after pose update include: Based on the curvature parameters of the model surface where the third component is located in the first model to be stitched, the target posture parameters corresponding to the fifth component adjacent to the fourth component are determined, and the posture of the fifth component is controlled to be adjusted to match the corresponding target posture parameters. Based on the curvature parameters of the model surface where the fourth component is located in the second model to be stitched, the target posture parameters corresponding to the sixth component adjacent to the third component are determined, and the posture of the sixth component is controlled to be adjusted to match the corresponding target posture parameters.

27. A road model generation device, characterized in that, A graphical user interface is provided via a terminal device, displaying a game editing scene to be edited provided by a running game program. The device includes: The road editing component display module is used to display a road model and multiple road editing components corresponding to the road model in the game editing scene to be edited in response to the road generation trigger operation; Wherein, at least some of the plurality of road editing components are located on the model surface of the road model; the display form of the road model is matched with the initial pose parameters of the plurality of road editing components; the display form is used to indicate the degree of curvature and twist of the road model; A component pose adjustment module is used to respond to pose adjustment operations for the road editing component and determine the current pose parameters of the road editing component. The road model update module is used to update the road model based on the current pose parameters of the multiple road editing components; pose refers to position and orientation.

28. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the road model generation method according to any one of claims 1-26.

29. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the road model generation method according to any one of claims 1-26.

Citation Information

Patent Citations

  • Image processing method, device and equipment and computer readable storage medium

    CN111768438A

  • Game scene editing method and device, electronic equipment and storage medium

    CN112717414A