Terrain editing method, apparatus and electronic device
By providing terrain component generation and multi-functional editing controls in the UGC editor, the problem of limited freedom in terrain editing is solved, enabling flexible creation and rich adjustment of terrain components.
Patent Information
- Application Number
- CN202411479041.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2044-10-22
AI Technical Summary
In the UGC editor, users cannot change the spatial location and shape of the terrain, limiting the freedom of terrain editing. Furthermore, the material settings for terrain components are cumbersome, making it difficult to create right-angled edges and use multiple materials alternately.
The system displays a graphical user interface on a terminal device, generates terrain components, and provides multiple terrain editing controls, allowing users to adjust the position, size, material, and height of terrain components in a virtual editing scene, including adjusting the terrain flatness.
It increases the freedom of setting the location of terrain components and the richness of terrain, allowing users to freely create terrain components and adjust their attributes in the virtual editing scene to meet personalized needs.
Smart Images

Figure CN119680199B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of game editing, and particularly to a terrain editing method, device and electronic equipment. BACKGROUND
[0002] In order to build a more realistic virtual environment in a UGC (User Generated Content) editor, a user needs to simulate the terrain of the real world. In the related art, the user can increase or decrease the height of the terrain, modify the surface material, and thus modify the terrain by using a terrain editing brush tool. However, since the terrain belongs to a fixed part of a preset scene, the user cannot change the spatial position and shape of the terrain, thereby reducing the degree of freedom of terrain editing. SUMMARY
[0003] The purpose of the present disclosure is to provide a terrain editing method, device and electronic equipment to improve the editing degree of freedom of a terrain component in a virtual editing scene.
[0004] In a first aspect, the present disclosure provides a terrain editing method, which includes: displaying a graphical user interface by a terminal device, the graphical user interface including a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control; in response to a first editing operation, controlling a terrain component corresponding to the terrain component control to be generated at a specified position of the virtual editing scene; controlling a plurality of terrain editing controls for the terrain component to be displayed in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness or terrain material of the terrain component; in response to a target terrain editing control in the plurality of terrain editing controls being triggered, a second editing operation acting on the terrain component, adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, and displaying the adjusted terrain component in the virtual editing scene.
[0005] In a second aspect, the present disclosure provides a terrain editing device, comprising: an interface display module configured to display a graphical user interface on a terminal device, the graphical user interface comprising a virtual editing scene and a component creation window; wherein the component creation window comprises a terrain component control; a component generation module configured to, in response to the terrain component control being dragged to a specified position in the virtual editing scene, control generation of a terrain component corresponding to the terrain component control at the specified position; a control display module configured to display a plurality of terrain editing controls for the terrain component in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions comprise adjusting a terrain height, a terrain flatness or a terrain material of the terrain component; and a component editing module configured to, in response to a second editing operation being performed on the terrain component after a target terrain editing control in the plurality of terrain editing controls is triggered, adjust the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, and display the adjusted terrain component in the virtual editing scene.
[0006] In a third aspect, the present disclosure provides an electronic device, comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, and the processor executes the machine executable instructions to implement the terrain editing method.
[0007] In a fourth aspect, the present disclosure provides a computer readable storage medium, the computer readable storage medium storing computer executable instructions, and the computer executable instructions, when invoked and executed by a processor, cause the processor to implement the terrain editing method.
[0008] The embodiments of the present disclosure bring the following beneficial effects:
[0009] The method, device and electronic equipment for editing terrain provided by the present disclosure first display a graphical user interface through a terminal device, the graphical user interface includes a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control; then, in response to a first editing operation, a terrain component corresponding to the terrain component control is generated at a specified position of the virtual editing scene; then, a plurality of terrain editing controls for the terrain component are displayed in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness or terrain material of the terrain component; then, in response to a second editing operation acting on the terrain component after triggering a target terrain editing control in the plurality of terrain editing controls, the terrain component is adjusted based on the second editing operation and the editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene. This way can generate one or more terrain components at any position in the virtual editing scene according to the first editing operation, thereby improving the freedom of terrain component position setting; at the same time, this way can adjust the height and material of the terrain component through the terrain editing control, thereby improving the richness of the terrain.
[0010] Other features and advantages of the present disclosure will be described in the following description, or can be inferred from the description, or can be determined without doubt, or can be known by implementing the above-mentioned technologies of the present disclosure.
[0011] In order to make the above-mentioned purposes, features and advantages of the present disclosure more obvious and easy to understand, the following preferred embodiments are specifically described in detail below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0013] Figure 1 A flowchart of a terrain editing method provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of a terrain component provided by an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of a graphical user interface in which a first control is displayed provided by an embodiment of the present disclosure;
[0016] Figure 4 A display schematic diagram of focusing on displaying a terrain component provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of displaying a brush shape adjusting control and a brush size adjusting control is provided for an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of adjusting the flatness of a terrain is provided for an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of adjusting the material of a terrain is provided for an embodiment of the present disclosure;
[0020] Figure 8 A structural schematic diagram of a terrain editing device is provided for an embodiment of the present disclosure;
[0021] Figure 9 A structural schematic diagram of an electronic device is provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] To make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described below in connection with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings can be arranged and designed in various different configurations.
[0023] Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the claimed present disclosure, but only represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present disclosure.
[0024] In order to build a more realistic virtual environment in the editor, the user needs to simulate the terrain of the real world. In the related art, in the UGC editor, by entering the terrain editing mode, the height and ground style of the preset terrain component in the preset scene are modified. However, since the terrain component is a component that is not created by the user independently and belongs to the preset scene, the user cannot change the spatial position and size of the terrain, nor can the user create multiple discontinuous terrains; in the ground material, only 4 brushes can be set, and when multiple different materials are used alternately, they need to be re-set, and the terrain component can only support the set brush material. In addition, since the brush shape is fixed and cannot build a right-angle edge terrain, it is relatively difficult to draw a square ground, and after each terrain editing, the user needs to save before returning to the scene editing, and after exiting the terrain editing, the user cannot undo the last edited terrain modification.
[0025] Based on the above problems, the technical solutions of the embodiments of the present disclosure provide a terrain editing method, device and electronic equipment, which can be applied to a game editing scene, especially to an editing scene of a terrain component in the game editing scene.
[0026] The terrain editing method in one of the embodiments of the present disclosure can run on a local terminal device or a server. When the terrain editing method runs on the server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0027] In an optional embodiment, various cloud applications, such as cloud games, can run under the cloud interaction system. Taking the cloud game as an example, the cloud game refers to a game mode based on cloud computing. In the running mode of the cloud game, the running body of the game program and the game canvas presentation body are separated, and the storage and running of the terrain editing method are completed on the cloud game server. The client device is used for receiving and sending data and presenting the game canvas. For example, the client device can be a display device close to the user side with a data transmission mode, such as a mobile terminal, a television, a computer, a palm computer, etc. However, the cloud game server in the cloud end performs information processing. When playing the game, the user operates the client device to send operation instructions to the cloud game server, the cloud game server runs the game according to the operation instructions, encodes and compresses the game canvas and other data, returns the data to the client device through the network, and finally decodes and outputs the game canvas through the client device.
[0028] In an optional embodiment, taking the game as an example, the local terminal device stores the game program and is used for presenting the game canvas. The local terminal device is used for interacting with the user through the graphical user interface, that is, the conventional game program is downloaded and installed on the electronic device and is run. The way in which the local terminal device provides the graphical user interface to the user can include various ways, for example, the graphical user interface can be rendered and displayed on the display screen of the terminal, or the graphical user interface can be provided to the user through holographic projection. For example, the local terminal device can include a display screen and a processor, the display screen is used for presenting the graphical user interface, the graphical user interface includes the game canvas, and the processor is used for running the game, generating the graphical user interface and controlling the display of the graphical user interface on the display screen.
[0029] In a possible embodiment, the present disclosure provides a terrain editing method, as shown in Figure 1 The method includes the following specific steps:
[0030] In step S102, a graphical user interface is displayed through a terminal device, and the graphical user interface includes a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control.
[0031] In a specific implementation, the graphical user interface is displayed when a game program is running on the terminal device or when a UGC editor application is running; the game program can be an application of any game, and the terminal device can be the local terminal device mentioned above or a client device in the cloud interaction system mentioned above. For example, the terminal device can be a mobile phone, a tablet computer, a personal computer, or the like. The virtual editing scene is a scene provided by the game program or the UGC editor application, and can also be understood as a scene in the editing stage provided by the UGC editor. The virtual editing scene can include one or more scene components and one or more terrain components, and the components can be edited in the virtual editing scene. In actual application, when the user triggers an editing instruction, the virtual editing scene can be displayed in the graphical user interface, and the editing instruction can be determined according to an editing rule. For example, the editing instruction can be an operation of entering the UGC editor, or an operation of selecting a certain scene map for editing, and the like.
[0032] Specifically, the component creation window can include scene component controls and terrain component controls; the component type and component form of the scene component controls included in the component creation window can be set according to research and development needs. For example, the component creation window can include scene component controls of multiple different types, including terrain component controls, mechanism component controls, structure component controls, decoration component controls, and combination component controls, and the like. Each type of scene component control also includes multiple scene component controls. For example, the mechanism component controls include movement mechanism component controls, function mechanism component controls, logic component controls, object component controls, and floor component controls. The movement mechanism component controls include cylinders, gears, cross gears, and clockwise rotating discs, and the like. The scene component controls are used to generate scene components in the virtual editing scene, and the terrain component controls are used to generate terrain components in the virtual editing scene. The terrain components and the scene components are different, the component model corresponding to the terrain component can be dynamically changed according to user operations, and the component model corresponding to the scene component cannot be changed. Moreover, the component model corresponding to the terrain component includes a height map and a material map, wherein the height map is used to control the terrain height of the terrain component, and the material map is used to control the terrain material of the terrain component.
[0033] In step S104, in response to the first editing operation, a terrain component corresponding to the terrain component control is generated at a specified position in the virtual editing scene.
[0034] The specific operation corresponding to the first editing operation can be determined according to research and development requirements. For example, the first editing operation can be an operation of dragging a terrain component control in a component creation window to a specified position in the virtual editing scene, or a click operation on the specified position in the virtual editing scene after clicking the terrain component control in the component creation window. Specifically, the specified position can be determined according to a user operation. The specified position can be any position in the virtual editing scene. In a specific implementation, the user can create one or more terrain components at any position in the virtual editing scene through the first editing scene, thereby improving the degree of freedom of terrain component creation.
[0035] In a specific embodiment, the virtual editing scene includes at least one terrain component. The terrain component in the present disclosure is not a part of the virtual editing scene that is pre-set, but one or more terrain components can be set at any position in the virtual editing scene according to a user operation, thereby meeting the individual needs of the user.
[0036] In step S106, a plurality of terrain editing controls for the terrain component are displayed in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness, or terrain material of the terrain component.
[0037] In a specific implementation, after the terrain component is generated in the virtual editing scene, the terrain editing mode can be entered to display a plurality of terrain editing controls for the terrain component in the graphical user interface. Each terrain editing control is pre-configured with a corresponding editing function. Different terrain editing controls correspond to different editing functions. The editing function corresponding to each terrain editing control can be one of the following: adjusting the terrain height, terrain flatness, or terrain material of the terrain component. The terrain height is used to indicate the height of the terrain component. The terrain flatness is used to specify the difference between the maximum height and the minimum height in the terrain component. Generally, the greater the difference, the lower the terrain flatness. The terrain material is used to indicate the style of the material map of the terrain component. The terrain material can include, but is not limited to, grass, soil, lake, and the like.
[0038] In a specific embodiment, when the terrain component is generated in the virtual editing scene, the terrain editing mode can be directly entered, and a plurality of terrain editing controls can be displayed in the graphical user interface.
[0039] In another specific embodiment, the step of controlling the display of the plurality of terrain editing controls for the terrain component in the graphical user interface further comprises, in response to a specified editing operation for the terrain component, displaying the plurality of terrain editing controls for the terrain component in the graphical user interface after the user performs the specified editing operation on the terrain component. The specific operation corresponding to the specified editing operation can be determined according to the development requirements and user operations, for example, the specified editing operation can be a click operation, a long press operation or a drag operation on the terrain component in the virtual editing scene. This way can select one or more terrain components in the virtual editing scene for editing when multiple terrain components are included in the virtual editing scene.
[0040] In step S108, in response to the second editing operation acting on the terrain component after triggering the target terrain editing control in the plurality of terrain editing controls, the terrain component is adjusted based on the second editing operation and the editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene.
[0041] In specific implementation, the target terrain editing control can be any one of the plurality of terrain editing controls, and the specific terrain editing control can be determined according to the development requirements. The user can trigger the target terrain editing control by clicking or long pressing, and perform the second editing operation on the terrain component after triggering the target terrain editing control. At least part of the terrain component can be adjusted based on the editing function corresponding to the target terrain editing control and the second editing operation, and the adjusted terrain component is displayed in the virtual editing scene to observe whether the performance effect of the adjusted terrain component meets the user's demand.
[0042] The terrain editing method provided by the embodiments of the present disclosure can generate one or more terrain components at any position in the virtual editing scene according to the first editing operation, which improves the degree of freedom of position setting of the terrain component. At the same time, the method can adjust the height and material of the terrain component through the terrain editing control, which improves the richness of the terrain.
[0043] The following embodiments are used to describe the interface display effect after entering the terrain editing mode.
[0044] Specifically, the terrain component is a component model of a preset shape. The preset shape can be determined according to the development requirements, for example, the preset shape can be a rectangle, a trapezoid or a circle, etc.
[0045] In a specific embodiment, the terrain component can be a three-dimensional model of a preset shape, and the three-dimensional model has a height map and a material map corresponding thereto. The height map is used to indicate the height of each vertex on a two-dimensional plane corresponding to the bottom surface of the terrain component. Based on the height map and the two-dimensional plane corresponding to the bottom surface, the three-dimensional model can be generated, and the material map is assigned to the upper surface of the three-dimensional model to obtain the terrain component.
[0046] As shown in Figure 2 FIG. 1 shows a schematic diagram of a terrain component provided by an embodiment of the present disclosure, Figure 2 The three terrain components shown in FIG. 1 have an initial state of a rectangular two-dimensional grid, which is also the two-dimensional plane corresponding to the bottom surface of the terrain component. The points on the two-dimensional grid are also the vertices of the two-dimensional plane. If the overall terrain height of the terrain component is 1 meter, the height of each point on the two-dimensional grid needs to be set to 1 meter, so as to obtain a cuboid with a height of 1 meter, which is the terrain component with a height of 1 meter. The terrain component occupies a large part of the game scene, and is used to create models or shapes related to the game environment and the landscape on the area, such as hills, low-lying areas, or other component models, such as trees, buildings, vehicles, etc. During the game running, the terrain component generates a corresponding terrain model, and the player character performs the game tasks configured in the game on the terrain model.
[0047] Further, in response to a third editing operation on the terrain component, the position and / or size of the terrain component in the virtual editing scene are adjusted. The specific operation corresponding to the third editing operation can be determined according to the development requirements and user operations. For example, the third editing operation can be a drag operation on the terrain component, and the position of the terrain component in the virtual editing scene is adjusted through the drag operation. The third editing operation can also be a zoom operation on the selected terrain component, and the size of the terrain component in the virtual editing scene is adjusted through the zoom operation. The third editing operation can also be a trigger operation on the zoom control or the movement control displayed in the graphical user interface after the terrain component is selected, wherein the zoom control is used to adjust the size of the terrain component, and the movement control is used to adjust the position of the terrain component.
[0048] Further, the specific process of controlling the display of the plurality of terrain editing controls for the terrain component in the graphical user interface can include: in response to a selection operation on the terrain component, selecting the terrain component and displaying a first control in the graphical user interface; and in response to a trigger operation on the first control, controlling the display of the plurality of terrain editing controls corresponding to the selected terrain component in the graphical user interface.
[0049] In a specific implementation, the trigger operation on the first control can be determined according to the development requirement, for example, can be a click operation or a long press operation on the first control, can also be a trigger operation on a terrain editing button displayed in the graphical user interface after clicking the first control, and the like.
[0050] As shown in Figure 3 a schematic diagram of displaying the first control in the graphical user interface provided by the embodiment of the present disclosure. Figure 3 The dark gray terrain component in the figure is the currently selected terrain component, and the light gray terrain component is the unselected terrain component. The display state of the selected terrain component is different from that of the unselected terrain component. After selecting a certain terrain component, a toolbar and a "ground editing" control are displayed in the graphical user interface. The "ground editing" control is the first control described above. The user clicks the "ground editing" control to enter the terrain editing mode for the selected terrain component. Or, after selecting a certain terrain component, the terrain editing mode of the selected terrain component is directly controlled to enter. In the terrain editing mode, or after selecting a certain terrain component, a plurality of terrain editing controls are displayed in the graphical user interface. The toolbar is also the delete control, the move control, the zoom control, the rotation control, and the advanced setting displayed below the "ground editing" control. Triggering the delete control deletes the selected terrain component from the virtual editing scene. Triggering the move control adjusts the position of the terrain component in the virtual editing scene. Triggering the zoom control adjusts the size of the terrain component in the virtual editing scene. Triggering the rotation control adjusts the angle of the terrain component in the virtual editing scene. The advanced setting is used to set the name of the terrain component and precisely edit the terrain component, and the like.
[0051] In another optional embodiment, the first control can also be an advanced setting control. The trigger operation on the first control is that the user triggers the advanced setting control, displays an editing window for the selected terrain component in the graphical user interface, and then clicks a terrain editing button in the editing window.
[0052] Further, when the plurality of terrain editing controls for the terrain component are displayed in the graphical user interface, the virtual editing scene is controlled to enter the terrain editing mode, and the terrain component is focused and displayed in the graphical user interface. In a specific implementation, the screen displayed in the graphical user interface is generated by a virtual camera collecting the virtual editing scene. When the virtual editing scene enters the terrain editing mode, the virtual camera adjusts the camera parameters to focus on the front of the terrain component, so as to focus and display the terrain component in the graphical user interface. Based on this way, the user can more clearly view the adjusted effect of the terrain component.
[0053] As shown in Figure 4 a display schematic diagram of focusing and displaying the terrain component provided by the embodiment of the present disclosure. Figure 4The rectangle with the grid in the figure is a terrain component in the focus display, that is, the zoom-in display Figure 3 After the terrain component selected in the figure, the terrain component after the focus display, the graphical user interface also displays a plurality of terrain editing controls after the focus display of the terrain component, Figure 4 The plurality of terrain editing controls in the figure include a height control, a flatness control, and a material control, wherein the height control is used to adjust the terrain height of the terrain component, the flatness control is used to adjust the terrain flatness of the terrain component, and the material control is used to adjust the terrain material of the terrain component.
[0054] Further, the above-mentioned graphical user interface further includes an exit control; based on this, in response to a triggering operation for the exit control, the virtual editing scene is controlled to exit the terrain editing mode, and the focus display of the terrain component in the graphical user interface is cancelled. Specifically, in the terrain editing mode, the user triggers the exit control to exit the terrain editing mode and restore to the scene editing mode, that is, the virtual camera adjusts the camera parameters to the camera parameters before the terrain editing mode, thereby cancelling the focus display of the terrain component, and the virtual camera based on the camera parameter adjustment collects the virtual editing scene to obtain the display picture in the graphical user interface. For example, the state of the virtual editing scene shown in the figure can be called the scene editing mode, and the state of the virtual editing scene shown in the figure can be called the terrain editing mode. Figure 3 Figure 4 The state of the virtual editing scene shown in the figure can be called the scene editing mode, and the state of the virtual editing scene shown in the figure can be called the terrain editing mode, Figure 4 The upper left corner in the figure shows an exit control, and the user clicks the exit control to switch from the terrain editing mode to the scene editing mode.
[0055] Further, in response to the virtual editing scene entering the terrain editing mode, a view angle control control is displayed in the graphical user interface; wherein the view angle control control is used to adjust the position of the virtual camera in the virtual editing scene, and the virtual camera is used to collect the virtual editing scene to form a scene picture in the graphical user interface. Wherein, when the virtual editing scene enters the terrain editing mode, the game view angle is opened by default, so that the view angle control control is displayed in the virtual editing scene, and the player can control the virtual camera to move in the virtual editing scene by controlling the view angle control control. At the same time when the virtual camera moves, the scene picture displayed in the graphical user interface also changes.
[0056] In this embodiment, after the virtual editing scene enters the terrain editing mode, the control adopts the view control mode corresponding to the terrain editing mode. For example, a first view control control is displayed on the left side of the graphical user interface, and a second view control control is displayed on the right side of the graphical user interface. The first view control control is configured to respond to touch operations and control the virtual camera to move horizontally. For example, the first view control control is a joystick control. By dragging the joystick control, the virtual camera is controlled to move on a plane parallel to the horizontal plane and capture the scene. The second view control control is configured to respond to touch operations and control the virtual camera to move in a direction perpendicular to the horizontal plane. For example, the second view control control includes two arrow-shaped controls. By triggering different controls, the virtual camera is controlled to move up or down in a direction perpendicular to the horizontal plane and capture the scene.
[0057] It should be noted that if the virtual editing scene was controlled using a view control mode corresponding to the terrain editing mode before entering the terrain editing mode, then the view control mode will not change after entering the terrain editing mode. However, if a different view control mode was used for the virtual editing scene before entering the terrain editing mode, then the view control mode will be switched after entering the terrain editing mode. In an optional implementation, after entering the terrain editing mode and switching the view control mode, the user can still switch the view control mode again.
[0058] like Figure 4 The graphical user interface displays two controls in the lower left corner: Control 1 (equivalent to the first-view control mentioned above) containing two circles and Control 2 (equivalent to the second-view control mentioned above) containing two arrows. Control 1 controls the virtual camera to move in various directions on a plane within the virtual editing scene, while Control 2 controls the virtual camera to move above or below that plane. This method allows control of the virtual camera's position via view controls, avoiding the triggering of components within the virtual editing scene when adjusting the virtual camera's position by sliding the scene view, thus enhancing the user's component editing experience.
[0059] The following examples describe how to adjust the terrain component.
[0060] Specifically, the process of adjusting the terrain component based on the second editing operation applied to the terrain component after triggering the target terrain editing control among multiple terrain editing controls can be achieved through the following steps 10-11:
[0061] Step 10, in response to a triggering operation on a target terrain editing control in the plurality of terrain editing controls, controlling to display a brush tool in the graphical user interface.
[0062] In a specific implementation, when the user triggers any one of the plurality of terrain editing controls, the brush tool is displayed at a preset position in the graphical user interface, so as to determine the editing area of the terrain component by the brush tool, thereby adjusting the editing area. The preset position can be determined according to the research and development requirements, for example, the preset position can be the center position of the graphical user interface or the center position of the terrain component, etc.
[0063] Step 11, in response to a second editing operation of the brush tool on the terrain component, determining a target editing area in the terrain component based on the second editing operation, and adjusting the target editing area based on the editing function corresponding to the target terrain editing control.
[0064] In a specific implementation, the specific operation corresponding to the second editing operation can be determined according to the research and development requirements, in a specific embodiment, the second editing operation includes a click operation or a sliding operation based on the brush tool acting on the terrain component. When the second editing operation is a click operation, the target editing area is the clicked position in the terrain component; when the second editing operation is a sliding operation, the target editing area is the area slid in the terrain component. In actual application, when the user performs the second editing operation on the terrain component by the brush tool, the target editing area is determined according to the triggering position of the second editing operation in the terrain component, and the target editing area is adjusted according to the function corresponding to the target terrain editing control.
[0065] In an optional embodiment, the brush tool is an interactive tool with a specified shape and a specified size; the specified shape and the specified size here can be pre-set according to the research and development requirements, or can be adjusted according to the user's requirements. Based on this, the specific process of determining the target editing area in the terrain component based on the second editing operation can include: determining the brush tool's brush effective range based on the brush tool's corresponding specified shape and specified size; determining the target editing area based on the brush effective range and the action position of the second editing operation acting on the terrain component.
[0066] In a specific implementation, the specified shape and the specified size of the brush tool are mainly used to determine the brush effective range, and the determination method of the brush effective range corresponding to different brush shapes is the same, but the shape corresponding to the brush effective range is different, wherein the shape corresponding to the brush effective range matches the brush shape. Therefore, based on the brush tool, an editing area of any shape can be drawn on the terrain component, thereby meeting the different drawing requirements of the user and improving the precision of terrain editing.
[0067] In a specific embodiment, when determining the effective range of the brush, a rectangular region can be first determined according to the brush size, and then the largest brush shape is generated in the rectangular region, where the largest brush shape is the effective range of the brush. Specifically, the brush size can be used to indicate the side length of the rectangular region, and generally the larger the brush size, the larger the rectangular region. Among them, the brush size affects the size of the effective range of the brush, and the brush shape affects the shape of the effective range of the brush.
[0068] Further, the user can adjust the brush size by: in response to a triggering operation on a target terrain editing control in the plurality of terrain editing controls, controlling a brush size adjustment control to be displayed in the graphical user interface; and in response to a first adjustment operation on the brush size adjustment control, adjusting the size of the brush tool displayed in the graphical user interface based on the first adjustment operation. In specific implementation, the specific operation corresponding to the above-mentioned first adjustment operation can be determined according to the research and development requirements, for example, the first adjustment operation can be an operation of inputting a specific numerical value in the brush size adjustment control, and it can also be an operation of sliding the brush size adjustment control left or right to increase or decrease the brush size.
[0069] Further, the user can also adjust the brush shape by: in response to a triggering operation on a target terrain editing control in the plurality of terrain editing controls, controlling a brush shape adjustment control to be displayed in the graphical user interface; and in response to a second adjustment operation on the brush shape adjustment control, adjusting the shape of the brush tool displayed in the graphical user interface based on the second adjustment operation. In specific implementation, the specific operation corresponding to the above-mentioned second adjustment operation can be determined according to the research and development requirements, for example, the second adjustment operation can be an operation of selecting any one of a plurality of preset brush shapes provided by the brush shape adjustment control, and it can also be an operation of inputting a specified shape in the brush shape control, etc.
[0070] As shown in Figure 5 The schematic diagram of displaying the brush shape adjustment control and the brush size adjustment control provided by the embodiment of the present disclosure is shown. When the user triggers the height control (equivalent to the above-mentioned target terrain editing control) displayed in the graphical user interface, the brush shape adjustment control and the brush size adjustment control will be displayed in the graphical user interface. The current brush size is 0.75, the user can click the numerical box to which 0.75 belongs to call the numeric keypad, then input the numerical value, and determine the input value as the brush size. At the same time, this method supports quickly adjusting the numerical value by holding the numerical box and dragging, for example, moving to the right to increase the numerical value, and moving to the left to decrease the numerical value, and determining the adjusted numerical value as the brush size. The user clicks the brush shape adjustment control to call the shape display list, which includes a plurality of preset brush shapes, and the user can select any one of the preset brush shapes as the specified shape of the brush tool.
[0071] In a specific implementation, the preset brush shape can include, but is not limited to, a sphere, a square, a cylinder, a triangle, a rectangle, and the like.
[0072] It should be noted that if the brush shape is a three-dimensional shape, the brush effective range determined based on the specified shape and the specified size of the brush tool is a three-dimensional range, and the target editing region determined based on the brush effective range and the second editing operation is a three-dimensional interval, the adjustment value corresponding to each position on the three-dimensional interval can vary. For example, if the brush shape is a sphere, and the target editing region is also a sphere when adjusting the height of the terrain, the height of the center point of the sphere can be higher, and the height gradually decreases on both sides of the center point. If the brush shape is a cylinder or a square, the adjustment height corresponding to each position of the target editing region is the same.
[0073] In an optional embodiment, when the brush size of the brush tool is adjusted through the brush size adjustment control, the specified size of the brush tool displayed in the graphical user interface changes according to the adjustment of the brush size, thereby previewing the size of the brush effective range. In addition, when the brush shape of the brush tool is adjusted through the brush shape adjustment control, the specified shape of the brush tool displayed in the graphical user interface changes according to the adjustment of the brush shape, thereby previewing the shape of the brush effective range. In another optional embodiment, when the size and shape of the brush effective range are previewed, the brush tool automatically disappears after a preset time period, thereby reducing the space occupation of the editing interface.
[0074] In an optional embodiment, the terrain component includes a component model formed by a plurality of model vertices connected to each other, and a material map of the surface of the component model. The material map is used to indicate the terrain material of the terrain component. Based on this, the specific process of adjusting the target editing region based on the editing function corresponding to the target terrain editing control can include: determining the target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation; adjusting the height of the model vertex located in the target editing region or adjusting the terrain material corresponding to the target editing region based on the target editing parameter.
[0075] In a specific implementation, different terrain editing controls correspond to different editing functions, and different terrain editing controls correspond to different target editing parameters. For example, if the editing function corresponding to the target terrain editing control is to adjust the terrain height, the target editing parameter is the height value, and thus the terrain height corresponding to the target editing region needs to be adjusted based on the target editing parameter; if the editing function corresponding to the target terrain editing control is to adjust the terrain flatness, the target editing parameter is the flatness, and thus the terrain height corresponding to the target editing region needs to be adjusted based on the target editing parameter, so that the terrain height difference of the model vertex included in the target editing region is smaller, and thus the terrain is more flat; if the editing function corresponding to the target terrain editing control is to adjust the terrain material, the target editing parameter is the target material map, and thus the material map corresponding to the target editing region needs to be replaced with the target material map.
[0076] In an optional embodiment, if the editing function corresponding to the target terrain editing control includes adjusting the terrain height of the terrain component, the specific process of adjusting the target editing region based on the editing function corresponding to the target terrain editing control can include: determining a height adjustment value corresponding to a single editing operation, and determining a target editing number corresponding to a second editing operation; based on the target editing number and the height adjustment value corresponding to the single editing operation, determining a target adjustment height value, and determining the target adjustment height value as the target editing parameter. The specific process of adjusting the height parameter of the vertex corresponding to the target editing region based on the target editing parameter can include: determining the adjusted terrain height parameter corresponding to the target editing region according to the current terrain height parameter corresponding to the model vertex located in the target editing region and the target adjustment height value.
[0077] The height adjustment value corresponding to the single editing operation can be pre-set by a developer, or can be set according to user operation. The height adjustment value corresponding to the single editing operation is used to indicate the height value that can be increased or decreased by one editing operation. For example, assuming that a single click operation is used as a single editing operation, if the second editing operation is a double-click operation, the target editing number corresponding to the second editing operation is two; if a single sliding operation is used as a single editing operation, the second editing operation slides through a certain region three times, and the target editing number corresponding to the second editing operation is three.
[0078] In a specific implementation, the product of the adjustment height value corresponding to the single editing operation and the target editing number can be determined as the target adjustment height value, and then the current terrain height parameter corresponding to the model vertex located in the target editing region is obtained. The adjusted terrain height parameter corresponding to the target editing region can be obtained by adding or subtracting the target adjustment height value from the terrain height parameter.
[0079] In a specific embodiment, the height adjustment value corresponding to the single editing operation includes a positive value or a negative value. Based on this, the current terrain height parameter corresponding to the model vertex located in the target editing region can be added to the target adjustment height value, and the sum is determined as the adjusted terrain height parameter corresponding to the target editing region. Thus, when the height adjustment value corresponding to the single editing operation is a positive value, the terrain height corresponding to the target editing region will be raised, and when the height adjustment value corresponding to the single editing operation is a negative value, the terrain height corresponding to the target editing region will be lowered.
[0080] Further, the user can adjust the height adjustment value corresponding to the single editing operation in the following manner: in response to a trigger operation on the target terrain editing control, control the display of the first input control in the graphical user interface; in response to a first input operation on the first input control, determine the height adjustment value corresponding to the single editing operation based on the first input operation. In specific implementation, the specific operation corresponding to the first input operation can be determined according to the research and development requirements.
[0081] As Figure 5 the "draw height" control in the "terrain editing" interface is the first input control, and the value 0.85 in the value box in the first input control is the currently set height adjustment value corresponding to the single editing operation. When adjusting the height adjustment value, the user can click the value box in the first input control to call up the number keyboard, then input a target value in the value box based on the number keyboard, and determine the target value as the height adjustment value corresponding to the single editing operation.
[0082] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain flatness of the terrain component, which can eliminate sharp height differences and irregular changes on the terrain, making the terrain more gentle and natural; the terrain flatness is used to indicate the terrain height difference, and generally the smaller the terrain height difference of a certain terrain region, the more flat the terrain; based on this, the specific process of determining the target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation can include: determining the flatness corresponding to the single editing operation, and determining the target editing times corresponding to the second editing operation; based on the target editing times and the flatness corresponding to the single editing operation, determining the target flatness, and determining the target flatness as the target editing parameter. Then, based on the target flatness, adjust the terrain height corresponding to the model vertex located in the target editing region.
[0083] The flatness degree corresponding to the single editing operation can be pre-set by the R&D personnel, or can be set according to the user operation. The flatness degree corresponding to the single editing operation is used to indicate the height value that can be increased or decreased by one editing operation. In specific implementation, the product of the flatness degree corresponding to the single editing operation times and the target editing times can be determined as the target flatness degree, and then the current terrain height parameter corresponding to the model vertex located in the target editing region and the terrain height average value are obtained, and the terrain height corresponding to the target editing region is adjusted based on the target flatness degree, so that the height difference of the terrain height corresponding to the target editing region gradually becomes smaller, that is, the terrain height region corresponding to the target editing region becomes flat.
[0084] In actual application, the flatness degree corresponding to the single editing operation is proportional to the terrain flattening speed of the target editing region, wherein the terrain flattening is used to indicate that the terrain height between the model vertices located in the target editing region is the same. Specifically, the greater the flatness degree corresponding to the single editing operation, the faster the terrain flattening speed of the target editing region. For example, when the flatness degree is large, the user can perform one editing operation to make the terrain of the target editing region flat; when the flatness degree is small, the user can perform multiple editing operations to make the terrain of the target editing region flat, thereby reducing the terrain flattening speed.
[0085] Further, the specific process of adjusting the terrain height corresponding to the model vertex located in the target editing region based on the target flatness degree can be implemented through the following steps 20-21:
[0086] Step 20, determining the height average value corresponding to the terrain height of the model vertex located in the target editing region.
[0087] In specific implementation, the height average value corresponding to the target editing region can be determined according to the terrain height of the model vertex in the target region.
[0088] Step 21, adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree.
[0089] Since the height average value is the terrain height corresponding to the target editing region when it is flat, the terrain height of the target terrain region can be gradually or directly adjusted to the height average value according to the height average value and the target average degree.
[0090] In an optional embodiment, the step 21 can be implemented by the following steps: if the target flattening degree is a preset flattening degree, adjusting the terrain height corresponding to the model vertex located in the target editing region to the height average value. The preset flattening degree can be a value determined according to the development requirements, for example, the preset flattening degree can be set to 1 or other values. When the target flattening degree is the preset flattening degree, the terrain height corresponding to the target editing region can be directly set to the height average value, so that the target editing region becomes flat directly, which provides a one-key flattening function of the terrain.
[0091] In another optional embodiment, the step 21 can also be implemented by the following steps: for each model vertex located in the target editing region, the following operations are performed: determining the difference between the terrain height of the current model vertex and the height average value; if the difference is less than the target flattening degree, adjusting the terrain height of the current model vertex to the height average value; if the difference is not less than the target flattening degree, determining whether the terrain height of the current model vertex is higher than the height average value, if yes, lowering the terrain height of the current model vertex by the height value corresponding to the target flattening degree; if not, increasing the terrain height of the current model vertex by the height value corresponding to the target flattening degree. This way can gradually adjust the terrain height of the target editing region to the height average value according to the size of the target flattening degree, so that the target editing region can gradually become flat, which is beneficial to the user to set different terrain flattening degrees of the terrain effect.
[0092] Further, the user can also set the flattening degree corresponding to the single editing operation by the following way: in response to the triggering operation of the target terrain editing control, controlling to display a second input control in the graphical user interface; in response to the second input operation of the second input control, determining the flattening degree corresponding to the single editing operation based on the second input operation. In specific implementation, the specific operation corresponding to the second input operation can be determined according to the development requirements.
[0093] As Figure 6 shown is a schematic diagram for adjusting the terrain flattening degree provided by the embodiment of the present disclosure, Figure 6 The graphical user interface displayed when the user triggers the flattening control (equivalent to the target terrain editing control) is shown, and the "draw degree" control in the graphical user interface is the second input control, and the value 0.5 in the number box in the second input control is the currently set flattening degree corresponding to the single editing operation. When adjusting the flattening degree, the user can click the number box in the second input control to call up the number keyboard, then input the target value in the number box based on the number keyboard, and determine the target value as the flattening degree corresponding to the current editing operation.
[0094] In another optional embodiment, if the editing function corresponding to the target terrain editing control includes adjusting the terrain material of the terrain component, and the target editing parameters include the target terrain material, then the specific process of adjusting the terrain material corresponding to the target editing area may include: switching the terrain material of the target editing area to the target terrain material. That is, replacing the terrain material of the target editing area with the target terrain material, thereby changing the surface appearance of the terrain component.
[0095] The target terrain material can be set according to user needs. Specifically, when the target terrain editing control is triggered, a material adjustment control will be displayed in the graphical user interface. Based on this, the target terrain material is determined in the following way: in response to the trigger operation of the material adjustment control, multiple preset terrain materials are displayed in the graphical user interface; in response to the selection operation of the multiple preset terrain materials, the target terrain material is determined from the multiple preset terrain materials based on the selection operation. The multiple preset terrain materials are set according to development needs and are not specifically limited here. The target terrain material can be any one of the multiple preset terrain materials.
[0096] like Figure 7 The diagram shown is a schematic of adjusting terrain material according to an embodiment of this disclosure. When a user clicks the material control (equivalent to the target terrain editing control mentioned above), the material adjustment control will be displayed in the graphical user interface. When the user clicks or long-presses the material adjustment control, a panel displaying all preset terrain materials will be opened in the graphical user interface. The user can click to select any preset terrain material as the target terrain material, switch to the material corresponding to the target editing area using the target terrain material, and the panel will be automatically closed at the same time.
[0097] The above method allows users to set the shape and size of the brush tool, enabling them to create surface textures or terrains of any shape, thus increasing the richness of the terrain.
[0098] The following examples describe how to save and undo editing operations.
[0099] Specifically, the graphical user interface also includes a save control; the save control is used to save the adjusted terrain components determined based on the second editing operation. In the actual implementation, when the user completes the second editing operation, triggering the save control will save the operations prior to the second editing operation.
[0100] Further, the graphical user interface further includes a undo control and a restore control; the undo control is used to undo the second editing operation and display the terrain component before being edited based on the second editing operation in the virtual editing scene; the restore control is used to restore the second editing operation after the second editing operation is undone, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene. It can also be understood that the undo control can undo the current editing operation, and after the current editing operation is undone, the user triggers the restore control to restore the current editing operation.
[0101] In a specific implementation, it is assumed that the user first places a scene component in the scene editing mode (operation 1), then enters the terrain editing mode to modify the terrain B (operation 2), exits the terrain editing mode, returns to the scene editing mode, and then modifies the position of the next scene component (operation 3). At this time, the undo control is clicked to undo the modification of operation 3, the undo control is clicked again to undo the modification of operation 2, and the undo control is clicked again to undo the modification of operation 1. If the restore control is clicked at this time, the modification of operation 1 can be restored.
[0102] In the present disclosure, the operation stack of saving, undoing and restoring in the terrain editing mode is together with the editing operation in the scene editing mode, that is, each operation of terrain editing can be saved and restored at any time, thereby improving the efficiency of the user in terrain adjustment.
[0103] Corresponding to the method embodiment, the present disclosure also provides a terrain editing device, as shown in the figure, the device includes: Figure 8
[0104] The interface display module 90 is configured to display a graphical user interface through a terminal device, and the graphical user interface includes a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control.
[0105] The component generation module 91 is configured to, in response to dragging the terrain component control to a specified position of the virtual editing scene, control to generate a terrain component corresponding to the terrain component control at the specified position.
[0106] The control display module 92 is configured to display a plurality of terrain editing controls for the terrain component in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness or terrain material of the terrain component.
[0107] The component editing module 93 is configured to, in response to triggering a target terrain editing control in the plurality of terrain editing controls, perform a second editing operation on the terrain component, adjust the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, and display the adjusted terrain component in the virtual editing scene.
[0108] The terrain editing device can generate one or more terrain components at any position in the virtual editing scene according to the first editing operation, thereby improving the freedom of position setting of the terrain components; meanwhile, the height and material of the terrain components can be adjusted through the terrain editing control, thereby improving the richness of the terrain.
[0109] Specifically, the virtual editing scene includes at least one terrain component.
[0110] Further, the terrain component is a component model of a preset shape.
[0111] Further, the control display module 92 is configured to: in response to a selection operation on the terrain component, select the terrain component and display the first control in the graphical user interface; and in response to a triggering operation on the first control, control the graphical user interface to display a plurality of terrain editing controls corresponding to the selected terrain component.
[0112] Further, the device further includes a focusing module configured to: when the graphical user interface displays the plurality of terrain editing controls for the terrain component, control the virtual editing scene to enter a terrain editing mode, and focus on displaying the terrain component in the graphical user interface.
[0113] Further, the graphical user interface further includes an exit control; based on this, the device further includes a focus canceling module configured to: in response to a triggering operation on the exit control, control the virtual editing scene to exit the terrain editing mode, and cancel the focus on displaying the terrain component in the graphical user interface.
[0114] Further, the device further includes a movement control module configured to: in response to the virtual editing scene entering the terrain editing mode, control the graphical user interface to display a view control; wherein the view control is used to adjust the position of a virtual camera in the virtual editing scene, and the virtual camera is used to capture the virtual editing scene to form a scene picture in the graphical user interface.
[0115] Further, the component editing module 93 is configured to: in response to a triggering operation on a target terrain editing control in the plurality of terrain editing controls, control the graphical user interface to display a brush tool; and in response to a second editing operation of the brush tool on the terrain component, determine a target editing region in the terrain component based on the second editing operation, and adjust the target editing region based on an editing function corresponding to the target terrain editing control.
[0116] In a specific implementation, the second editing operation includes a click operation or a sliding operation of the brush tool on the terrain component.
[0117] Further, the brush tool has a specified shape and a specified size; based on this, the component editing module 93 is configured to: determine a brush effective range of the brush tool based on the specified shape and the specified size of the brush tool; and determine the target editing region based on the brush effective range and the action position of the second editing operation on the terrain component.
[0118] Further, the device further comprises a size adjusting module configured to: in response to a trigger operation on a target terrain editing control in the plurality of terrain editing controls, control a brush size adjusting control to be displayed in the graphical user interface; and in response to a first adjusting operation on the brush size adjusting control, adjust the size of the brush tool displayed in the graphical user interface based on the first adjusting operation.
[0119] Further, the device further comprises a shape adjusting module configured to: in response to a trigger operation on a target terrain editing control in the plurality of terrain editing controls, control a brush shape adjusting control to be displayed in the graphical user interface; and in response to a second adjusting operation on the brush shape adjusting control, adjust the shape of the brush tool displayed in the graphical user interface based on the second adjusting operation.
[0120] Further, the terrain component comprises: a component model formed by a plurality of model vertices connected to each other, and a material map of a surface of the component model; the material map is used to indicate a terrain material of the terrain component; based on this, the component editing module 93 is configured to: determine a target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation; and adjust the terrain height of the model vertices located in the target editing region or adjust the terrain material corresponding to the target editing region based on the target editing parameter.
[0121] In an optional embodiment, the editing function corresponding to the target terrain editing control comprises adjusting the terrain height of the terrain component; based on this, the component editing module 93 is configured to: determine a height adjustment value corresponding to a single editing operation, and determine a target editing number corresponding to the second editing operation; determine a target adjustment height value based on the target editing number and the height adjustment value corresponding to the single editing operation, and determine the target adjustment height value as the target editing parameter; and determine an adjusted terrain height parameter corresponding to the target editing region according to the current terrain height parameter corresponding to the model vertices located in the target editing region and the target adjustment height value.
[0122] Further, the height adjustment value corresponding to the single editing operation comprises a positive value or a negative value.
[0123] Further, the device includes a height value adjustment module configured to: in response to a triggering operation on the target terrain editing control, control the first input control to be displayed in the graphical user interface; and in response to a first input operation on the first input control, determine a height adjustment value corresponding to a single editing operation based on the first input operation.
[0124] Further, the editing function corresponding to the target terrain editing control includes adjusting terrain flatness of the terrain component, and the terrain flatness is used to indicate terrain height difference. Based on this, the component editing module 93 is configured to: determine a flatness corresponding to a single editing operation, and determine a target editing number corresponding to a second editing operation; determine a target flatness based on the target editing number and the flatness corresponding to the single editing operation, and determine the target flatness as a target editing parameter; and the step of adjusting terrain heights of the model vertices located in the target editing region includes: adjusting the terrain heights corresponding to the model vertices located in the target editing region based on the target flatness.
[0125] Further, the flatness corresponding to the single editing operation is proportional to a terrain flattening speed of the target editing region, and the terrain flattening is used to indicate that terrain heights between the model vertices located in the target editing region are the same.
[0126] Further, the component editing module 92 is configured to: determine a height average value corresponding to the terrain heights of the model vertices located in the target editing region; and adjust the terrain heights corresponding to the model vertices located in the target editing region based on the height average value and the target flatness.
[0127] Further, the component editing module 92 is further configured to: if the target flatness is a preset flatness, adjust the terrain heights corresponding to the model vertices located in the target editing region to the height average value.
[0128] Further, the component editing module 92 is further configured to: for each model vertex located in the target editing region, perform the following operations: determine a difference between a terrain height of a current model vertex and the height average value; if the difference is less than the target flatness, adjust the terrain height of the current model vertex to the height average value; if the difference is not less than the target flatness, determine whether the terrain height of the current model vertex is higher than the height average value, and if yes, reduce the terrain height of the current model vertex by a height value corresponding to the target flatness; and if not, increase the terrain height of the current model vertex by the height value corresponding to the target flatness.
[0129] Further, the device further includes a flatness adjustment module configured to: in response to a triggering operation on the target terrain editing control, control the second input control to be displayed in the graphical user interface; and in response to a second input operation on the second input control, determine the flatness corresponding to the single editing operation based on the second input operation.
[0130] Furthermore, the editing functions corresponding to the aforementioned target terrain editing control include adjusting the terrain material of the terrain component; the target editing parameters include the target terrain material; the aforementioned third editing module 93 is used to: switch the terrain material of the target editing area to the target terrain material.
[0131] Furthermore, when the target terrain editing control is triggered, a material adjustment control is displayed in the graphical user interface; based on this, the device also includes a material determination module, used to: respond to a trigger operation on the material adjustment control, control the display of multiple preset terrain materials in the graphical user interface; and respond to a selection operation on the multiple preset terrain materials, determine the target terrain material from the multiple preset terrain materials based on the selection operation.
[0132] Furthermore, the aforementioned device also includes a terrain editing module for: adjusting the position and / or size of the terrain component in the virtual editing scene in response to a third editing operation on the terrain component.
[0133] Furthermore, the graphical user interface described above also includes a save control; the save control is used to save the adjusted terrain component determined based on the second editing operation.
[0134] Furthermore, the graphical user interface also includes an undo control and a redo control; the undo control is used to: undo the second editing operation and display the terrain component before the second editing operation in the virtual editing scene; the redo control is used to: restore the second editing operation after undoing it and display the adjusted terrain component based on the second editing operation in the virtual editing scene.
[0135] The terrain editing device provided in this disclosure has the same implementation principle and technical effects as the aforementioned method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the aforementioned method embodiments.
[0136] This disclosure also provides an electronic device, such as... Figure 9 As shown, the electronic device includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the terrain editing method described above.
[0137] Specifically, the above terrain editing method comprises: displaying a graphical user interface through a terminal device, the graphical user interface comprising a virtual editing scene and a component creation window; wherein the component creation window comprises a terrain component control; in response to a first editing operation, controlling a terrain component corresponding to the terrain component control to be generated at a specified position of the virtual editing scene; controlling a plurality of terrain editing controls for the terrain component to be displayed in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions comprise adjusting the terrain height, terrain flatness or terrain material of the terrain component; in response to a target terrain editing control in the plurality of terrain editing controls being triggered, a second editing operation acting on the terrain component, the terrain component is adjusted based on the second editing operation and the editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene.
[0138] The above terrain editing method can generate one or more terrain components at any position in the virtual editing scene according to the first editing operation, thereby improving the freedom of position setting of the terrain component; meanwhile, the height and material of the terrain component can be adjusted through the terrain editing controls, thereby improving the richness of the terrain.
[0139] In an optional embodiment, the virtual editing scene comprises at least one terrain component.
[0140] In an optional embodiment, the terrain component is a component model of a preset shape.
[0141] In an optional embodiment, the step of controlling the plurality of terrain editing controls for the terrain component to be displayed in the graphical user interface comprises: in response to a selection operation for the terrain component, selecting the terrain component and displaying a first control in the graphical user interface; in response to a trigger operation for the first control, controlling the plurality of terrain editing controls corresponding to the selected terrain component to be displayed in the graphical user interface.
[0142] In an optional embodiment, the method further comprises: when the plurality of terrain editing controls for the terrain component are displayed in the graphical user interface, controlling the virtual editing scene to enter a terrain editing mode, and focusing on displaying the terrain component in the graphical user interface.
[0143] In an optional embodiment, the graphical user interface further comprises an exit control; the method further comprises: in response to a trigger operation for the exit control, controlling the virtual editing scene to exit the terrain editing mode, and unfocusing on displaying the terrain component in the graphical user interface.
[0144] In an optional embodiment, the method further comprises: in response to the virtual editing scene entering the terrain editing mode, controlling to display a view control control in the graphical user interface; wherein the view control control is used to adjust a position of a virtual camera in the virtual editing scene, and the virtual camera is used to capture the virtual editing scene to form a scene picture in the graphical user interface.
[0145] In an optional embodiment, in response to the triggering of the target terrain editing control in the plurality of terrain editing controls, the second editing operation acting on the terrain component, and the step of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush tool in the graphical user interface; in response to the second editing operation of the brush tool on the terrain component, determining a target editing area in the terrain component based on the second editing operation, and adjusting the target editing area based on the editing function corresponding to the target terrain editing control.
[0146] In an optional embodiment, the second editing operation comprises: a click operation or a sliding operation of the brush tool acting on the terrain component.
[0147] In an optional embodiment, the brush tool is an interactive tool with a specified shape and a specified size; and the step of determining the target editing area in the terrain component based on the second editing operation comprises: determining a brush effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; and determining the target editing area based on the brush effective range and a position of the terrain component acted on by the second editing operation.
[0148] In an optional embodiment, the method further comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush size adjustment control in the graphical user interface; and in response to a first adjustment operation on the brush size adjustment control, adjusting the size of the brush tool displayed in the graphical user interface based on the first adjustment operation.
[0149] In an optional embodiment, the method further comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush shape adjustment control in the graphical user interface; and in response to a second adjustment operation on the brush shape adjustment control, adjusting the shape of the brush tool displayed in the graphical user interface based on the second adjustment operation.
[0150] In an optional embodiment, the terrain component includes a component model formed by a plurality of model vertices connected to each other, and a material map of a surface of the component model, the material map being used to indicate a terrain material of the terrain component; and the step of adjusting the target editing region based on the editing function corresponding to the target terrain editing control includes: determining a target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation; and adjusting the terrain height of the model vertex located in the target editing region or adjusting the terrain material corresponding to the target editing region based on the target editing parameter.
[0151] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain height of the terrain component; and the step of adjusting the target editing region based on the editing function corresponding to the target terrain editing control includes: determining a height adjustment value corresponding to a single editing operation, and determining a target editing number corresponding to the second editing operation; determining a target adjustment height value based on the target editing number and the height adjustment value corresponding to the single editing operation, and determining the target adjustment height value as the target editing parameter; and the step of adjusting the height parameter of the vertex corresponding to the target editing region based on the target editing parameter includes: determining an adjusted terrain height parameter corresponding to the target editing region according to the current terrain height parameter corresponding to the model vertex located in the target editing region and the target adjustment height value.
[0152] In an optional embodiment, the height adjustment value corresponding to the single editing operation includes a positive value or a negative value.
[0153] In an optional embodiment, the method further includes: in response to a trigger operation on the target terrain editing control, controlling to display a first input control in the graphical user interface; and in response to a first input operation on the first input control, determining the height adjustment value corresponding to the single editing operation based on the first input operation.
[0154] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate a terrain height difference; and the step of determining the target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation includes: determining a flatness corresponding to a single editing operation, and determining a target editing number corresponding to the second editing operation; determining a target flatness based on the target editing number and the flatness corresponding to the single editing operation, and determining the target flatness as the target editing parameter; and the step of adjusting the terrain height of the model vertex located in the target editing region includes: adjusting the terrain height corresponding to the model vertex located in the target editing region based on the target flatness.
[0155] In an optional embodiment, the flatness degree corresponding to the single editing operation is proportional to a terrain flattening speed of the target editing region; wherein the terrain flattening is used to indicate that the terrain heights between the model vertices located in the target editing region are the same.
[0156] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region based on the target flatness degree comprises: determining a height average value corresponding to the terrain height of the model vertex located in the target editing region; and adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree.
[0157] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree comprises: if the target flatness degree is a preset flatness degree, adjusting the terrain height corresponding to the model vertex located in the target editing region to the height average value.
[0158] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree comprises: for each model vertex located in the target editing region, performing the following operations: determining a difference value between the terrain height of the current model vertex and the height average value; if the difference value is less than the target flatness degree, adjusting the terrain height of the current model vertex to the height average value; if the difference value is not less than the target flatness degree, determining whether the terrain height of the current model vertex is higher than the height average value, and if higher, reducing the terrain height of the current model vertex by a height value corresponding to the target flatness degree; and if not higher, increasing the terrain height of the current model vertex by the height value corresponding to the target flatness degree.
[0159] In an optional embodiment, the method further comprises: in response to a triggering operation on the target terrain editing control, controlling a second input control to be displayed in the graphical user interface; and in response to a second input operation on the second input control, determining the flatness degree corresponding to the single editing operation based on the second input operation.
[0160] In an optional embodiment, the editing function corresponding to the target terrain editing control comprises adjusting a terrain material of the terrain component; the target editing parameter comprises a target terrain material; and the step of adjusting the terrain material corresponding to the target editing region comprises: switching the terrain material of the target editing region to the target terrain material.
[0161] In an optional embodiment, when the target terrain editing control is triggered, a material adjustment control is displayed in the graphical user interface; the target terrain material is determined in the following manner: in response to a triggering operation on the material adjustment control, a plurality of preset terrain materials are controlled to be displayed in the graphical user interface; in response to a selection operation on the plurality of preset terrain materials, the target terrain material is determined from the plurality of preset terrain materials based on the selection operation.
[0162] In an optional embodiment, the method further includes: in response to a third editing operation on the terrain component, adjusting the position and / or size of the terrain component in the virtual editing scene.
[0163] In an optional embodiment, the graphical user interface further includes a save control; the save control is used to save the adjusted terrain component determined based on the second editing operation.
[0164] In an optional embodiment, the graphical user interface further includes a undo control and a restore control; the undo control is used to: undo the second editing operation and display the terrain component edited before the second editing operation in the virtual editing scene; the restore control is used to: restore the second editing operation after the second editing operation is undone, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene.
[0165] Further, Figure 9 The electronic device shown further includes a bus 102 and a communication interface 103, the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
[0166] The memory 100 can include a high-speed random access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. The communication between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0167] The processor 101 can be an integrated circuit chip having a processing capability of signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the processor 101. The processor 101 described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present disclosure can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and combines the hardware to complete the steps of the method of the above embodiments.
[0168] The embodiments of the present disclosure further provide a computer readable storage medium, which stores computer executable instructions. When the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to implement the above terrain editing method. For details, refer to the method embodiments, which will not be repeated here.
[0169] Specifically, the above terrain editing method comprises: displaying a graphical user interface through a terminal device, the graphical user interface comprising a virtual editing scene and a component creation window; wherein the component creation window comprises a terrain component control; in response to a first editing operation, controlling a terrain component corresponding to the terrain component control to be generated at a specified position of the virtual editing scene; controlling a plurality of terrain editing controls for the terrain component to be displayed in the graphical user interface; wherein the plurality of terrain editing controls are respectively configured with corresponding editing functions, and the editing functions comprise adjusting the terrain height, terrain flatness or terrain material of the terrain component; in response to a target terrain editing control in the plurality of terrain editing controls being triggered, a second editing operation acting on the terrain component, the terrain component is adjusted based on the second editing operation and the editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene.
[0170] The above terrain editing method can generate one or more terrain components at any position in the virtual editing scene according to the first editing operation, thereby improving the freedom of position setting of the terrain component; meanwhile, the height and material of the terrain component can be adjusted through the terrain editing controls, thereby improving the richness of the terrain.
[0171] In an optional embodiment, the virtual editing scene comprises at least one terrain component.
[0172] In an optional embodiment, the terrain component is a component model of a preset shape.
[0173] In an optional embodiment, the step of controlling the plurality of terrain editing controls for the terrain component to be displayed in the graphical user interface comprises: in response to a selection operation for the terrain component, selecting the terrain component and displaying a first control in the graphical user interface; in response to a trigger operation for the first control, controlling the plurality of terrain editing controls corresponding to the selected terrain component to be displayed in the graphical user interface.
[0174] In an optional embodiment, the method further comprises: when the plurality of terrain editing controls for the terrain component are displayed in the graphical user interface, controlling the virtual editing scene to enter a terrain editing mode, and focusing on displaying the terrain component in the graphical user interface.
[0175] In an optional embodiment, the graphical user interface further comprises an exit control; the method further comprises: in response to a trigger operation for the exit control, controlling the virtual editing scene to exit the terrain editing mode, and unfocusing on displaying the terrain component in the graphical user interface.
[0176] In an optional embodiment, the method further comprises: in response to the virtual editing scene entering the terrain editing mode, controlling to display a view control control in the graphical user interface; wherein the view control control is used to adjust a position of a virtual camera in the virtual editing scene, and the virtual camera is used to capture the virtual editing scene to form a scene picture in the graphical user interface.
[0177] In an optional embodiment, in response to the triggering of the target terrain editing control in the plurality of terrain editing controls, the second editing operation acting on the terrain component, and the step of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush tool in the graphical user interface; in response to the second editing operation of the brush tool on the terrain component, determining a target editing area in the terrain component based on the second editing operation, and adjusting the target editing area based on the editing function corresponding to the target terrain editing control.
[0178] In an optional embodiment, the second editing operation comprises: a click operation or a sliding operation of the brush tool acting on the terrain component.
[0179] In an optional embodiment, the brush tool is an interactive tool with a specified shape and a specified size; and the step of determining the target editing area in the terrain component based on the second editing operation comprises: determining a brush effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; and determining the target editing area based on the brush effective range and a position of the terrain component acted on by the second editing operation.
[0180] In an optional embodiment, the method further comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush size adjustment control in the graphical user interface; and in response to a first adjustment operation on the brush size adjustment control, adjusting the size of the brush tool displayed in the graphical user interface based on the first adjustment operation.
[0181] In an optional embodiment, the method further comprises: in response to the triggering operation on the target terrain editing control in the plurality of terrain editing controls, controlling to display a brush shape adjustment control in the graphical user interface; and in response to a second adjustment operation on the brush shape adjustment control, adjusting the shape of the brush tool displayed in the graphical user interface based on the second adjustment operation.
[0182] In an optional embodiment, the terrain component includes a component model formed by a plurality of model vertices connected to each other, and a material map of a surface of the component model, the material map being used to indicate a terrain material of the terrain component; and the step of adjusting the target editing region based on the editing function corresponding to the target terrain editing control includes: determining a target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation; and adjusting the terrain height of the model vertex located in the target editing region or adjusting the terrain material corresponding to the target editing region based on the target editing parameter.
[0183] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain height of the terrain component; and the step of adjusting the target editing region based on the editing function corresponding to the target terrain editing control includes: determining a height adjustment value corresponding to a single editing operation, and determining a target editing number corresponding to the second editing operation; determining a target adjustment height value based on the target editing number and the height adjustment value corresponding to the single editing operation, and determining the target adjustment height value as the target editing parameter; and the step of adjusting the height parameter of the vertex corresponding to the target editing region based on the target editing parameter includes: determining an adjusted terrain height parameter corresponding to the target editing region according to the current terrain height parameter corresponding to the model vertex located in the target editing region and the target adjustment height value.
[0184] In an optional embodiment, the height adjustment value corresponding to the single editing operation includes a positive value or a negative value.
[0185] In an optional embodiment, the method further includes: in response to a trigger operation on the target terrain editing control, controlling to display a first input control in the graphical user interface; and in response to a first input operation on the first input control, determining the height adjustment value corresponding to the single editing operation based on the first input operation.
[0186] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate a terrain height difference; and the step of determining the target editing parameter matched with the editing function corresponding to the target terrain editing control based on the second editing operation includes: determining a flatness corresponding to a single editing operation, and determining a target editing number corresponding to the second editing operation; determining a target flatness based on the target editing number and the flatness corresponding to the single editing operation, and determining the target flatness as the target editing parameter; and the step of adjusting the terrain height of the model vertex located in the target editing region includes: adjusting the terrain height corresponding to the model vertex located in the target editing region based on the target flatness.
[0187] In an optional embodiment, the flatness degree corresponding to the single editing operation is proportional to a terrain flattening speed of the target editing region; wherein the terrain flattening is used to indicate that the terrain heights between the model vertices located in the target editing region are the same.
[0188] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region based on the target flatness degree comprises: determining a height average value corresponding to the terrain height of the model vertex located in the target editing region; and adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree.
[0189] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree comprises: if the target flatness degree is a preset flatness degree, adjusting the terrain height corresponding to the model vertex located in the target editing region to the height average value.
[0190] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing region according to the height average value and the target flatness degree comprises: for each model vertex located in the target editing region, performing the following operations: determining a difference value between the terrain height of the current model vertex and the height average value; if the difference value is less than the target flatness degree, adjusting the terrain height of the current model vertex to the height average value; if the difference value is not less than the target flatness degree, determining whether the terrain height of the current model vertex is higher than the height average value, and if higher, reducing the terrain height of the current model vertex by a height value corresponding to the target flatness degree; and if not higher, increasing the terrain height of the current model vertex by the height value corresponding to the target flatness degree.
[0191] In an optional embodiment, the method further comprises: in response to a triggering operation on the target terrain editing control, controlling a second input control to be displayed in the graphical user interface; and in response to a second input operation on the second input control, determining the flatness degree corresponding to the single editing operation based on the second input operation.
[0192] In an optional embodiment, the editing function corresponding to the target terrain editing control comprises adjusting a terrain material of the terrain component; the target editing parameter comprises a target terrain material; and the step of adjusting the terrain material corresponding to the target editing region comprises: switching the terrain material of the target editing region to the target terrain material.
[0193] In an optional embodiment, when the target terrain editing control is triggered, a material adjustment control is displayed in the graphical user interface; the target terrain material is determined in the following manner: in response to a triggering operation on the material adjustment control, a plurality of preset terrain materials are controlled to be displayed in the graphical user interface; in response to a selection operation on the plurality of preset terrain materials, the target terrain material is determined from the plurality of preset terrain materials based on the selection operation.
[0194] In an optional embodiment, the method further comprises: in response to a third editing operation on the terrain component, adjusting the position and / or size of the terrain component in the virtual editing scene.
[0195] In an optional embodiment, the graphical user interface further comprises a save control; the save control is used to save the adjusted terrain component determined based on the second editing operation.
[0196] In an optional embodiment, the graphical user interface further comprises a undo control and a restore control; the undo control is used to: undo the second editing operation and display the terrain component before being edited based on the second editing operation in the virtual editing scene; the restore control is used to: restore the second editing operation after the second editing operation is undone, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene.
[0197] The manner, if realized in the form of a software unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the disclosure, essentially or the part that contributes to the prior art, or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the disclosure. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0198] In the description of the disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the purpose of facilitating the description of the disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the disclosure. In addition, the terms "first", "second", "third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0199] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit the same. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any modification or easy-to-think change, or equivalent replacement of part of the technical features of the technical solutions recorded in the foregoing embodiments can still be made within the technical range disclosed by the present disclosure by any person skilled in the art. The essence of the corresponding technical solution does not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A terrain editing method, characterized in that, The method includes: A graphical user interface is displayed through a terminal device, the graphical user interface including a virtual editing scene and a component creation window; wherein, the component creation window includes terrain component controls; In response to the first editing operation, the terrain component corresponding to the terrain component control is generated at a specified location in the virtual editing scene; The system controls the display of multiple terrain editing controls for the terrain component in the graphical user interface; wherein each of the multiple terrain editing controls is configured with a corresponding editing function, the editing function including adjusting the terrain height, terrain flatness, or terrain texture of the terrain component; In response to triggering the target terrain editing control among the plurality of terrain editing controls, a second editing operation is performed on the terrain component, the terrain component is adjusted based on the second editing operation and the editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene; The step of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control after triggering the target terrain editing control includes: In response to a trigger operation targeting a target terrain editing control among the plurality of terrain editing controls, control the display of the brush tool in the graphical user interface; In response to a second editing operation on the terrain component based on the brush tool, a target editing area is determined in the terrain component, and the target editing area is adjusted based on the editing function corresponding to the target terrain editing control.
2. The method according to claim 1, characterized in that, The virtual editing scene includes at least one terrain component.
3. The method according to claim 1, characterized in that, The terrain component is a component model with a preset shape.
4. The method according to claim 1, characterized in that, The step of controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface includes: In response to a selection operation on the terrain component, the terrain component is selected and a first control is displayed in the graphical user interface; In response to a trigger operation on the first control, control the display of multiple terrain editing controls corresponding to the selected terrain component in the graphical user interface.
5. The method according to claim 1 or 4, characterized in that, The method further includes: When multiple terrain editing controls for the terrain component are displayed in the graphical user interface, the virtual editing scene is controlled to enter the terrain editing mode, and the terrain component is focused on and displayed in the graphical user interface.
6. The method according to claim 5, characterized in that, The graphical user interface also includes an exit control; the method further includes: In response to the trigger operation of the exit control, the virtual editing scene is controlled to exit the terrain editing mode, and the terrain component is defocused in the graphical user interface.
7. The method according to claim 5, characterized in that, The method further includes: In response to the virtual editing scene entering terrain editing mode, a view control control is displayed in the graphical user interface; wherein, the view control control is used to adjust the position of the virtual camera in the virtual editing scene, and the virtual camera is used to capture the virtual editing scene to form a scene image in the graphical user interface.
8. The method according to claim 1, characterized in that, The second editing operation includes: a click or swipe operation based on the brush tool applied to the terrain component.
9. The method according to claim 1, characterized in that, The brush tool is an interactive tool with a specified shape and size; The step of determining the target editing area in the terrain component based on the second editing operation includes: The effective range of the brush tool is determined based on the specified shape and size of the brush tool. The target editing area is determined based on the effective range of the brush and the position of the second editing operation within the terrain component.
10. The method according to claim 9, characterized in that, The method further includes: In response to a trigger operation targeting a target terrain editing control among the plurality of terrain editing controls, control the display of a brush size adjustment control in the graphical user interface; In response to a first adjustment operation on the brush size adjustment control, the size of the brush tool displayed in the graphical user interface is adjusted based on the first adjustment operation.
11. The method according to claim 9, characterized in that, The method further includes: In response to a trigger operation targeting a target terrain editing control among the plurality of terrain editing controls, control the display of a brush shape adjustment control in the graphical user interface; In response to a second adjustment operation on the brush shape adjustment control, the shape of the brush tool displayed in the graphical user interface is adjusted based on the second adjustment operation.
12. The method according to claim 1, characterized in that, The terrain component includes: a component model formed by interconnecting multiple model vertices, and a material map on the surface of the component model; the material map is used to indicate the terrain material of the terrain component. The step of adjusting the target editing area based on the editing function corresponding to the target terrain editing control includes: Based on the second editing operation, target editing parameters that match the editing function corresponding to the target terrain editing control are determined; Based on the target editing parameters, adjust the terrain height of the model vertices located in the target editing area, or adjust the terrain material corresponding to the target editing area.
13. The method according to claim 12, characterized in that, The editing functions corresponding to the target terrain editing control include adjusting the terrain height of the terrain component; The step of determining the target editing parameters that match the editing function corresponding to the target terrain editing control based on the second editing operation includes: Determine the height adjustment value corresponding to a single editing operation, and determine the target number of edits corresponding to the second editing operation; Based on the target number of edits and the height adjustment value corresponding to the single edit operation, a target adjustment height value is determined, and the target adjustment height value is determined as the target editing parameter; The step of adjusting the terrain height of model vertices located in the target editing region based on the target editing parameters includes: Based on the terrain height parameters currently corresponding to the model vertices located in the target editing area and the target adjusted height value, the adjusted terrain height parameters corresponding to the target editing area are determined.
14. The method according to claim 13, characterized in that, The height adjustment value corresponding to a single editing operation can be positive or negative.
15. The method according to claim 13, characterized in that, The method further includes: In response to a trigger operation on the target terrain editing control, control the display of a first input control in the graphical user interface; In response to a first input operation on the first input control, a height adjustment value corresponding to a single editing operation is determined based on the first input operation.
16. The method according to claim 12, characterized in that, The editing functions corresponding to the target terrain editing control include adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate differences in terrain height. The step of determining the target editing parameters that match the editing function corresponding to the target terrain editing control based on the second editing operation includes: Determine the leveling force corresponding to a single editing operation, and determine the target number of edits corresponding to the second editing operation; Based on the target number of edits and the smoothing force corresponding to the single edit operation, the target smoothing force is determined, and the target smoothing force is determined as the target edit parameter; The step of adjusting the terrain height of the model vertices located in the target editing area includes: adjusting the terrain height corresponding to the model vertices located in the target editing area based on the target flattening force.
17. The method according to claim 16, characterized in that, The leveling force corresponding to a single editing operation is proportional to the terrain leveling speed of the target editing area; wherein, the terrain leveling is used to indicate that the terrain height between model vertices located in the target editing area is the same.
18. The method according to claim 16, characterized in that, The step of adjusting the terrain height corresponding to the model vertices located in the target editing area based on the target flatness intensity includes: Determine the average height corresponding to the terrain height of the model vertices located in the target editing area; Based on the average height and the target leveling force, adjust the terrain height corresponding to the model vertices located in the target editing area.
19. The method according to claim 18, characterized in that, The step of adjusting the terrain height corresponding to the model vertices located in the target editing area based on the average height and the target flattening force includes: If the target leveling force is a preset leveling force, the terrain height corresponding to the model vertex located in the target editing area is adjusted to the average height.
20. The method according to claim 18, characterized in that, The step of adjusting the terrain height corresponding to the model vertices located in the target editing area based on the average height and the target flattening force includes: For each model vertex located in the target editing region, perform the following operations: Determine the difference between the terrain height of the current model vertex and the average height; If the difference is less than the target leveling force, the terrain height of the current model vertex is adjusted to the average height. If the difference is not less than the target leveling force, determine whether the terrain height of the current model vertex is higher than the average height. If it is higher, reduce the terrain height of the current model vertex to the height value corresponding to the target leveling force. If it is not higher, increase the terrain height of the current model vertex by the height value corresponding to the target leveling force.
21. The method according to claim 16, characterized in that, The method further includes: In response to a trigger operation on the target terrain editing control, control the display of a second input control in the graphical user interface; In response to a second input operation on the second input control, the smoothing force corresponding to a single editing operation is determined based on the second input operation.
22. The method according to claim 12, characterized in that, The editing functions corresponding to the target terrain editing control include adjusting the terrain material of the terrain component; the target editing parameters include the target terrain material; The step of adjusting the terrain material corresponding to the target editing area includes: Switch the terrain material of the target editing area to the target terrain material.
23. The method according to claim 22, characterized in that, When the target terrain editing control is triggered, a material adjustment control is displayed in the graphical user interface; The target terrain material is determined in the following way: In response to a trigger operation on the material adjustment control, control the display of multiple preset terrain materials in the graphical user interface; In response to a selection operation for the plurality of preset terrain materials, a target terrain material is determined from the plurality of preset terrain materials based on the selection operation.
24. The method according to claim 1, characterized in that, The method further includes: In response to a third editing operation on the terrain component, the position and / or size of the terrain component in the virtual editing scene are adjusted.
25. The method according to claim 1, characterized in that, The graphical user interface also includes a save control; the save control is used to save the adjusted terrain component determined based on the second editing operation.
26. The method according to claim 1, characterized in that, The graphical user interface also includes an undo control and a redo control; the undo control is used to: undo the second editing operation and display the terrain component before editing based on the second editing operation in the virtual editing scene; the redo control is used to: restore the second editing operation after undoing the second editing operation and display the adjusted terrain component based on the second editing operation in the virtual editing scene.
27. A terrain editing device, characterized in that, The device includes: The interface display module is used to display a graphical user interface through a terminal device. The graphical user interface includes a virtual editing scene and a component creation window; wherein, the component creation window includes terrain component controls. The component generation module is used to respond to dragging the terrain component control to a specified position in the virtual editing scene and control the generation of the terrain component corresponding to the terrain component control at the specified position; A control display module is used to control the display of multiple terrain editing controls for the terrain component in the graphical user interface; wherein, the multiple terrain editing controls are configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness or terrain texture of the terrain component; The component editing module is used to respond to a second editing operation on the terrain component after triggering a target terrain editing control among the plurality of terrain editing controls, adjust the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control, and display the adjusted terrain component in the virtual editing scene; The component editing module is further configured to: respond to a trigger operation on a target terrain editing control among the plurality of terrain editing controls, and control the display of a brush tool in the graphical user interface; respond to a second editing operation on the terrain component based on the brush tool, determine a target editing area in the terrain component, and adjust the target editing area based on the editing function corresponding to the target terrain editing control.
28. An electronic device, characterized in that, The electronic device 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 terrain editing method according to any one of claims 1 to 26.
29. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the terrain editing method according to any one of claims 1 to 26.
Citation Information
Patent Citations
Solid-state terrain editing method and device, electronic equipment and computer storage medium
CN112085856A
Scene terrain editing method and device, electronic terminal and machine readable storage medium
CN113750519A