Terrain editing method and device and electronic equipment
By generating and adjusting terrain components in virtual editing scenes, the problem that users cannot change the spatial location and shape of the terrain is solved, and the freedom of terrain editing and the richness of terrain are improved.
Patent Information
- Application Number
- CN202411479041.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-10-22
AI Technical Summary
In the prior art, users cannot change the spatial position and shape of the terrain, reducing the freedom of terrain editing.
The graphical user interface displays the virtual editing scene and component creation window, and users can generate terrain components at the specified location of the virtual editing scene, and adjust the height, flatness, or material of the terrain components through multiple terrain editing controls.
Improve the freedom of position setting of terrain components, and increase the richness of terrain by adjusting the properties of terrain components.
Smart Images

Figure CN119680199A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of game editing, and in particular to a terrain editing method, device and electronic device. Background Art
[0002] In order to build a more realistic virtual environment in a UGC (User Generated Content) editor, users need to simulate the terrain of the real world. In related technologies, users can modify the terrain by increasing or decreasing the height of the terrain and modifying the surface material through the terrain editing brush tool. However, since the terrain is a fixed part of the preset scene, users cannot change the spatial position and shape of the terrain, which reduces the degree of freedom of terrain editing. Summary of the invention
[0003] The purpose of the present disclosure is to provide a terrain editing method, device and electronic device to enhance the editing freedom of terrain components in a virtual editing scene.
[0004] In a first aspect, the present disclosure provides a terrain editing method, the method comprising: displaying a graphical user interface through 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 the generation of a terrain component corresponding to the terrain component control at a specified position of the virtual editing scene; controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface; wherein the multiple 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 triggering a target terrain editing control among the multiple terrain editing controls, acting on a second editing operation of 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, which includes: an interface display module, which is used to display a graphical user interface through a terminal device, wherein the graphical user interface includes a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control; a component generation module, which is used to control the generation of a terrain component corresponding to the terrain component control at the specified position in response to dragging the terrain component control to a specified position of the virtual editing scene; a control display module, which 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 respectively configured with corresponding editing functions, and the editing functions include adjusting the terrain height, terrain flatness or terrain material of the terrain component; a component editing module, which is used to respond to triggering a target terrain editing control among the multiple terrain editing controls, act on the terrain component for a second editing operation, 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, which includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned terrain editing method.
[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned terrain editing method.
[0008] The embodiments of the present disclosure bring the following beneficial effects:
[0009] The present disclosure provides a terrain editing method, device and electronic device, firstly displaying a graphical user interface through a terminal device, wherein 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, controlling to generate a terrain component corresponding to the terrain component control at a specified position of the virtual editing scene; then controlling to display multiple terrain editing controls for the terrain component in the graphical user interface; wherein the multiple 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 triggering a target terrain editing control among the multiple terrain editing controls, acting on the terrain component after a second editing operation, 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. This 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 degree of freedom of setting the position of the terrain component; at the same time, this method 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 set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0011] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred implementation modes and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[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 showing a first control in a graphical user interface provided by an embodiment of the present disclosure;
[0016] Figure 4 A display schematic diagram of a focused display terrain component provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram showing a brush shape adjustment control and a brush size adjustment control provided in an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of adjusting terrain flatness provided in an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of adjusting terrain material provided by an embodiment of the present disclosure;
[0020] Figure 8 A schematic diagram of the structure of a terrain editing device provided by an embodiment of the present disclosure;
[0021] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are 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 here 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 accompanying drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.
[0024] In order to build a more realistic virtual environment in the editor, users need 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 surface style of the preset terrain components in the preset scene are modified. However, since the terrain component is not a component created by the user independently and is part of the preset scene, the user cannot change the spatial position and size of the terrain, nor can they create multiple discontinuous terrains; in the surface material, only 4 brushes can be set, and multiple different materials need to be reset when used alternately. The terrain component can only support the set brush material. In addition, since the brush shape is fixed and it is impossible to build a terrain with right-angled edges, it is difficult to draw a square surface, and after each terrain edit, it needs to be saved before returning to the scene edit. After exiting the terrain edit, the last edited terrain modification cannot be undone.
[0025] Based on the above problems, the embodiments of the present disclosure provide a terrain editing method, device and electronic device. The technology can be applied to game editing scenarios, especially to editing scenarios of terrain components in game editing scenarios.
[0026] The terrain editing method in one embodiment of the present disclosure can be run on a local terminal device or a server. When the terrain editing method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0027] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the running body of the game program and the game canvas presentation body are separated. The storage and operation of the terrain editing method are completed on the cloud game server. The role of 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 with a data transmission method close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the user operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game canvas and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game canvas.
[0028] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game canvas. The local terminal device is used to interact with the user through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the user in a variety of ways, for example, it may be rendered and displayed on the display screen of the terminal, or provided to the user through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game canvas, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0029] In a possible implementation, the present disclosure provides a terrain editing method, such as Figure 1 As shown, the method comprises the following specific steps:
[0030] Step S102, displaying a graphical user interface through a terminal device, wherein 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 above-mentioned graphical user interface is displayed when a game program is running on a terminal device or when a UGC editor application is running; wherein the game program can be an application for any game, and the terminal device can be the local terminal device mentioned above, or it can be a client device in the cloud interaction system mentioned above. For example, the terminal device can be a mobile phone, a tablet computer, or a personal computer. The above-mentioned virtual editing scene is a scene provided by running a game program or a 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 can also include one or more terrain components, and the components can be edited in the virtual editing scene. In actual applications, when a user triggers an editing instruction, a virtual editing scene can be displayed in a graphical user interface, and the editing instruction can be determined according to the editing rules. For example, the editing instruction can be an operation to enter the UGC editor; it can also be an operation to select a scene map for editing, etc.
[0032] Specifically, the above-mentioned component creation window may include a scene component control and a terrain component control; the component type and component form of the scene component control included in the component creation window can be set according to the research and development requirements. For example, the component editing window may include multiple different types of scene component controls, including: terrain component controls, mechanism component controls, structure components, decoration component controls, and combination component controls, etc., and each type of scene component control also includes multiple scene component controls. For example, the mechanism component control also includes a motion mechanism component control, a functional mechanism component control, a logic component control, an object component control, and a floor component control, wherein the motion mechanism component control also includes a cylinder, a gear, a cross gear, a clockwise turntable, etc. The above-mentioned scene component control is used to generate a scene component in a virtual editing scene, and the terrain component control is used to generate a terrain component in a virtual editing scene. The terrain component is different from the scene component. The component model corresponding to the terrain component can be dynamically changed according to the user operation, while the component model corresponding to the scene component cannot be changed, and 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] Step S104, in response to the first editing operation, controlling the generation of a terrain component corresponding to the terrain component control at a designated position of the virtual editing scene.
[0034] The specific operation corresponding to the above-mentioned first editing operation can be determined according to the research and development needs. For example, the first editing operation can be an operation of dragging the terrain component control in the component creation window to a specified position in the virtual editing scene, or it can be an operation of clicking the terrain component control in the component creation window and then clicking the specified position in the virtual editing scene. Specifically, the above-mentioned specified position can be determined according to the user operation, and the specified position can be any position in the virtual editing scene. In 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 increasing 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 pre-set part of the virtual editing scene, but one or more terrain components can be set at any position in the virtual editing scene according to user operations, so as to meet the personalized needs of users.
[0036] Step S106, controlling the display of 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.
[0037] In specific implementation, after generating a terrain component in a virtual editing scene, you can enter the terrain editing mode to display multiple terrain editing controls for the terrain component in the graphical user interface. Each terrain editing control is pre-configured with a corresponding editing function, and 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. Among them, the terrain height is used to indicate the height of the terrain component, and the terrain flatness is used to specify the difference between the maximum height and the minimum height in the terrain component. Generally, the larger the difference, the lower the terrain flatness; the terrain material is used for the style of the material map of the terrain component, and the terrain material can include but is not limited to grass, soil, lakes and other materials.
[0038] In a specific embodiment, when a terrain component is generated in a virtual editing scene, a terrain editing mode may be directly entered, and a plurality of terrain editing controls may be displayed in a graphical user interface.
[0039] In another specific embodiment, before the step of controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface, the step further includes responding to a specified editing operation for the terrain component, so that after the user performs the specified editing operation on the terrain component, multiple terrain editing controls for the terrain component are displayed in the graphical user interface. The specific operation corresponding to the specified editing operation can be determined according to R&D 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. In this way, when multiple terrain components are included in the virtual editing scene, one or more terrain components can be selected for editing.
[0040] Step S108, in response to triggering a target terrain editing control among multiple 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.
[0041] In specific implementation, the target terrain editing control may be any one of a plurality of terrain editing controls, and the specific terrain editing control of the target terrain editing control may be determined according to research and development requirements. The user may trigger the target terrain editing control by clicking or long pressing, and after the target terrain editing control is triggered, the user performs a second editing operation on the terrain component, and may adjust at least part of the area in the terrain component based on the editing function and the second editing operation corresponding to the target terrain editing control, and display the adjusted terrain component in the virtual editing scene, so as to observe whether the corresponding performance effect of the adjusted terrain component meets the user's requirements.
[0042] A terrain editing method provided by an embodiment of the present disclosure can generate one or more terrain components at any position in a virtual editing scene according to a first editing operation, thereby improving the freedom of setting the position of the terrain components; at the same time, this method can adjust the height and material of the terrain components through the terrain editing control, thereby improving the richness of the terrain.
[0043] The following embodiment is 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, wherein the preset shape can be determined according to research and development requirements, for example, the preset shape can be a rectangle, a trapezoid or a circle.
[0045] In a specific embodiment, the terrain component can be a three-dimensional model of a preset shape, which corresponds to a height map and a material map. The height map is used to indicate the height corresponding to each vertex on the two-dimensional plane corresponding to the bottom surface of the terrain component. A three-dimensional model can be generated based on the height map and the two-dimensional plane corresponding to the bottom surface, and the terrain component can be obtained by assigning a material map to the upper surface of the three-dimensional model.
[0046] like Figure 2 FIG. 1 is a schematic diagram of a terrain component provided by an embodiment of the present disclosure. Figure 2 There are three terrain components in the figure. The initial state of these three terrain components is a rectangular two-dimensional grid. The two-dimensional grid here is the two-dimensional plane corresponding to the bottom surface of the terrain component. The points on the two-dimensional grid are the vertices of the two-dimensional plane. If the overall terrain height of the terrain component is 1 meter, then 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. This cuboid is also a terrain component with a height of 1 meter. The terrain component occupies a large area in the game scene, and is used to create models or shapes related to the game environment, landforms, etc. in this area, such as hills and depressions. Or build other component models in this area, such as trees, buildings, vehicles, etc. When the game is running, the terrain component generates the corresponding terrain model, and the player character performs the game tasks configured in the game match on this terrain model.
[0047] Furthermore, in response to the third editing operation on the terrain component, the position and / or size of the terrain component in the virtual editing scene is adjusted. The specific operation corresponding to the third editing operation can be determined according to R&D 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 by the drag operation; the third editing operation can also be a zoom operation on the terrain component after the terrain component is selected, and the size of the terrain component in the virtual editing scene is adjusted by the zoom operation; the third editing operation can also be a trigger operation of the zoom control or the mobile 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 mobile control is used to adjust the position of the terrain component.
[0048] Furthermore, the specific process of controlling the display of multiple terrain editing controls for a terrain component in a graphical user interface may include: responding to a selection operation on a terrain component, selecting the terrain component and displaying a first control in the graphical user interface; and responding to a trigger operation on the first control, controlling the display of multiple terrain editing controls corresponding to the selected terrain component in the graphical user interface.
[0049] In specific implementation, the above-mentioned trigger operation for the first control can be determined according to research and development needs. For example, it can be a click operation or a long press operation on the first control, or it can be a trigger operation of the terrain editing button displayed in the graphical user interface after clicking the first control.
[0050] like Figure 3 Shown is a schematic diagram of displaying a first control in a graphical user interface provided by an 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 terrain component, a toolbar and a "land editing" control will be displayed in the graphical user interface. The "land editing" control is also the first control mentioned above. The user clicks the "land editing" control to enter the terrain editing mode for the selected terrain component. Or after selecting a terrain component, directly control to enter the terrain editing mode of the selected terrain component. In the terrain editing mode, or after selecting a terrain component, multiple terrain editing controls are displayed in the graphical user interface. The above toolbar is also the delete control, move control, scale control, rotate control and advanced settings displayed below the "land editing" control. Among them, triggering the delete control will delete the selected terrain component from the virtual editing scene, triggering the move control can adjust the position of the terrain component in the virtual editing scene, triggering the scale control can adjust the size of the terrain component in the virtual editing scene, triggering the rotate control can adjust the angle of the terrain component in the virtual editing scene, and the advanced settings are used to set the name of the terrain component and accurately edit the terrain component.
[0051] In another optional embodiment, the above-mentioned first control can also be an advanced setting control, and the above-mentioned triggering operation for 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 the terrain editing button in the editing window.
[0052] Furthermore, when multiple terrain editing controls for terrain components are displayed in the graphical user interface, the virtual editing scene is controlled to enter the terrain editing mode, and the terrain components are displayed in the graphical user interface in a focused manner. In a specific implementation, the image displayed in the graphical user interface is generated by capturing the virtual editing scene with a virtual camera. 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, thereby focusing on the terrain component in the graphical user interface. Based on this method, the user can more clearly view the effect of the adjusted terrain component.
[0053] like Figure 4 Shown is a display schematic diagram of a focused display terrain component provided by an embodiment of the present disclosure. Figure 4The rectangle with a grid in the image is the focused terrain component, which is the enlarged terrain component. Figure 3 After focusing on a terrain component, multiple terrain editing controls will be displayed in the graphical user interface. Figure 4 The multiple terrain editing controls in include height control, flatness control and material control. 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] Furthermore, the above-mentioned graphical user interface also includes an exit control; based on this, in response to the triggering operation of the exit control, the virtual editing scene is controlled to exit the terrain editing mode, and the terrain component displayed in the graphical user interface is defocused. Specifically, in the terrain editing mode, the user can exit the terrain editing mode by triggering the exit control and restore to the scene editing mode, that is, the virtual camera will adjust the camera parameters to the camera parameters before the terrain editing mode, thereby defocusing the terrain component, and based on the virtual camera with adjusted camera parameters, the virtual editing scene is captured to obtain the display screen in the graphical user interface. For example, Figure 3 The state of the virtual editing scene shown is called scene editing mode. Figure 4 The state of the virtual editing scene shown is called terrain editing mode. Figure 4 There is an exit control in the upper left corner of the screen. Users can click the exit control to switch from terrain editing mode to scene editing mode.
[0055] Further, in response to the virtual editing scene entering the terrain editing mode, the perspective control control is controlled to be displayed in the graphical user interface; wherein the perspective 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 screen in the graphical user interface. When the virtual editing scene enters the terrain editing mode, the game perspective is turned on by default, so that the perspective 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 manipulating the perspective control control. When the virtual camera moves, the scene screen displayed in the graphical user interface will also change accordingly.
[0056] In this embodiment, after the virtual editing scene enters the terrain editing mode, the control is controlled by the perspective control mode corresponding to the terrain editing mode. For example, a first perspective control control is displayed on the left side of the graphical user interface, and a second perspective control control is displayed on the right side of the graphical user interface, wherein the first perspective control control is configured to respond to touch operations and control the virtual camera to move in the horizontal direction, for example, the first perspective control control is a joystick control, and 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 perspective 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 perspective control control includes two arrow-shaped controls, and by triggering different controls, the virtual camera is controlled to move upward or downward in a direction perpendicular to the horizontal plane and capture the scene.
[0057] It should be noted that, if before entering the terrain editing mode, the virtual editing scene is controlled by the perspective control mode corresponding to the terrain editing mode, then the perspective control mode will not be changed after entering the terrain editing mode from the virtual editing scene; if before entering the terrain editing mode, the virtual editing scene is controlled by a mode different from the perspective control mode corresponding to the terrain editing mode, then the perspective control mode will be switched after entering the terrain editing mode from the virtual editing scene. In an optional implementation, after entering the terrain editing mode and switching the perspective control mode, the user can still switch the perspective control mode.
[0058] like Figure 4 In the lower left corner of the graphical user interface in the , there is a control 1 containing two circles (equivalent to the first perspective control control) and a control 2 containing two arrows (equivalent to the second perspective control control), wherein control 1 is used to control the virtual camera to move in various directions on a plane in the virtual editing scene, and control 2 is used to control the virtual camera to move above or below the plane. This method can control the position change of the virtual camera through the perspective control control, avoiding the situation where the components in the virtual editing scene are triggered when the position of the virtual camera is adjusted by sliding the scene screen, which helps to improve the user's component editing experience.
[0059] The following embodiments are used to describe the way of adjusting the terrain components.
[0060] Specifically, the above-mentioned second editing operation acting on the terrain component in response to triggering the target terrain editing control among the multiple terrain editing controls, and the specific process of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control can be implemented by the following steps 10-11:
[0061] Step 10, in response to a triggering operation on a target terrain editing control among the multiple terrain editing controls, controlling the display of a brush tool in a graphical user interface.
[0062] In a specific implementation, when a user triggers any one of the multiple terrain editing controls, a brush tool will be displayed at a preset position in the graphical user interface, so that the editing area of the terrain component can be determined by the brush tool, thereby adjusting the editing area. The preset position can be determined according to 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.
[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 an editing function corresponding to a target terrain editing control.
[0064] In specific implementation, the specific operation corresponding to the above-mentioned second editing operation can be determined according to research and development needs. In a specific embodiment, the above-mentioned 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 that is slid over in the terrain component. In actual applications, when the user performs the second editing operation on the terrain component through the brush tool, the target editing area is determined according to the trigger 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 R&D requirements, or can be adjusted according to user 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 effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; determining the target editing area based on the brush effective range and the action position of the second editing operation in the terrain component.
[0066] In specific implementation, the specified shape and size corresponding to the brush tool are mainly used to determine the effective range of the brush. The determination method of the effective range of the brush corresponding to different brush shapes is the same, but the shapes corresponding to the effective range of the brush are different, where the shape corresponding to the effective range of the brush 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 needs of users and improving the accuracy of terrain editing.
[0067] In a specific embodiment, when determining the effective range of the brush, a rectangular area can be first determined according to the brush size, and then the largest brush shape can be generated in the rectangular area. Here, the largest brush shape is also the effective range of the brush. Specifically, the brush size can be used to indicate the side length of the rectangular area. Generally, the larger the brush size, the larger the rectangular area. 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] Furthermore, the user can adjust the brush size in the following manner: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush size adjustment control in a graphical user interface; responding 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 first adjustment operation can be determined according to research and development requirements. For example, the first adjustment operation can be an operation of inputting a specific value in the brush size adjustment control, or an operation of sliding the brush size adjustment control left and right to increase or decrease the brush size.
[0069] Furthermore, the user can also adjust the brush shape in the following manner: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush shape adjustment control in the graphical user interface; responding 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 second adjustment operation can be determined according to research and development requirements. For example, the second adjustment operation can be an operation of selecting any one of the multiple preset brush shapes provided by the brush shape adjustment control, or an operation of inputting a specified shape in the brush shape control, etc.
[0070] like Figure 5 The figure shows a schematic diagram of a brush shape adjustment control and a brush size adjustment control provided by the embodiment of the present disclosure. When the user triggers the height control displayed in the graphical user interface (equivalent to the above-mentioned target terrain editing control), 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 value box belonging to 0.75 to call out the numeric keyboard, and then enter the value, and determine the input value as the brush size. At the same time, this method supports pressing and dragging the value box to quickly adjust the value, for example, moving to the right to increase the value, moving to the left to decrease the value, and determining the adjusted value as the brush size. When the user clicks the brush shape adjustment control, a shape display list will be called out, and the shape display list includes multiple preset brush shapes. 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 above-mentioned preset brush shapes may include but are not limited to: sphere, square, cylinder, triangle and rectangle, etc.
[0072] It should be noted that if the brush shape is a three-dimensional shape, the effective range of the brush determined based on the specified shape and specified size corresponding to the brush tool is also a three-dimensional range, and the target editing area determined based on the effective range of the brush and the second editing operation is also a three-dimensional interval, and the adjustment values corresponding to each position on this three-dimensional interval may vary. For example, if the brush shape is a sphere and the terrain height is adjusted, the target editing area is also a sphere, then the center point of the sphere may need to be higher, and the heights on both sides of the center point may gradually decrease; if the brush shape is a cylinder or a block, the adjustment heights corresponding to each position in the target editing area are 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 corresponding to the brush tool displayed in the graphical user interface will change according to the adjustment of the brush size, thereby previewing the size of the effective range of the brush; in addition, when the brush shape of the brush tool is adjusted through the brush shape adjustment control, the specified shape corresponding to the brush tool displayed in the graphical user interface will change according to the adjustment of the brush shape, thereby previewing the shape of the effective range of the brush. In another optional embodiment, when previewing the size and shape of the effective range of the brush, the brush tool will automatically disappear after being displayed for a preset period of time to reduce the space occupied by the editing interface.
[0074] In an optional embodiment, a 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; based on this, the specific process of adjusting the target editing area based on the editing function corresponding to the target terrain editing control may include: based on the second editing operation, determining the target editing parameters that match the editing function corresponding to the target terrain editing control; based on the target editing parameters, adjusting the terrain height of the model vertices located in the target editing area, or adjusting the terrain material corresponding to the target editing area.
[0075] In specific implementation, different terrain editing controls correspond to different editing functions, so 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, then the target editing parameter is the height value, so it is necessary to adjust the terrain height corresponding to the target editing area based on the target editing parameter; if the editing function corresponding to the target terrain editing control is to adjust the terrain flatness, then the target editing parameter is the flattening strength, so it is necessary to adjust the terrain height corresponding to the target editing area based on the target editing parameter, so that the terrain height difference corresponding to the model vertices contained in the target editing area is smaller, so that the terrain is more flat; if the editing function corresponding to the target terrain editing control is to adjust the terrain material, then the target editing parameter is the target material map, so it is necessary to replace the material map corresponding to the target editing area 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 area based on the editing function corresponding to the target terrain editing control may include: determining the height adjustment value corresponding to a single editing operation, and determining the target number of editing operations corresponding to the second editing operation; determining the target adjustment height value based on the target number of editing operations and the height adjustment value corresponding to the single editing operation, and determining the target adjustment height value as the target editing parameter. The specific process of adjusting the height parameters of the vertices corresponding to the target editing area based on the target editing parameters may include: determining the adjusted terrain height parameters corresponding to the target editing area according to the terrain height parameters currently corresponding to the model vertices located in the target editing area and the target adjustment height value.
[0077] The height adjustment value corresponding to the above-mentioned single editing operation can be pre-set by the R&D personnel, or it can be set according to the user operation. The height adjustment value corresponding to a single editing operation is used to indicate the height value that can be increased or decreased by a single editing operation. For example, if a single-click operation is used as a single editing operation, if the second editing operation is a double-click operation, then the target number of edits corresponding to the second editing operation is two; if a sliding operation is used as a single editing operation, then the second editing operation slides through a certain area three times, and the target number of edits corresponding to the second editing operation is three.
[0078] In specific implementation, the product of the adjustment height value corresponding to the number of single editing operations and the target editing number can be determined as the target adjustment height value, and then the terrain height parameter currently corresponding to the model vertex located in the target editing area is obtained. The target adjustment height value is added or subtracted from the terrain height parameter to obtain the adjusted terrain height parameter corresponding to the target editing area.
[0079] In a specific embodiment, the height adjustment value corresponding to a single editing operation includes a positive value or a negative value. Based on this, the terrain height parameter currently corresponding to the model vertex located in the target editing area can be added to the target adjustment height value, and the sum can be determined as the adjusted terrain height parameter corresponding to the target editing area. Therefore, when the height adjustment value corresponding to the single editing operation is a positive value, the terrain height corresponding to the target editing area will be increased, and when the height adjustment value corresponding to the single editing operation is a negative value, the terrain height corresponding to the target editing area will be decreased.
[0080] Furthermore, the user can adjust the height adjustment value corresponding to a single editing operation in the following manner: in response to a trigger operation on a target terrain editing control, control the display of a first input control in a 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 research and development requirements.
[0081] like Figure 5 The "Draw Height" control in the first input control is the first input control, and the 0.85 in the value box in the first input control is the height adjustment value corresponding to the current single editing operation. When adjusting the height adjustment value, the user can click the value box in the first input control to call out the numeric keyboard, and then enter the target value in the value box based on the numeric keyboard, and determine the target value as the height adjustment value corresponding to the current 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. This editing function 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 difference in terrain height. Generally, the smaller the difference in terrain height in a certain terrain area, the flatter the terrain; based on this, the specific process of determining the target editing parameter that matches the editing function corresponding to the target terrain editing control based on the second editing operation may include: determining the flattening force corresponding to a single editing operation, and determining the target number of edits corresponding to the second editing operation; determining the target flattening force based on the target number of edits and the flattening force corresponding to the single editing operation, and determining the target flatness as the target editing parameter. Then, based on the target flattening force, adjust the terrain height corresponding to the model vertex located in the target editing area.
[0083] The leveling force corresponding to the above-mentioned single editing operation can be pre-set by the R&D personnel, or it can be set according to the user operation. The leveling force corresponding to a single editing operation is used to indicate the height value that can be increased or decreased by a single editing operation. In a specific implementation, the product of the leveling force corresponding to the number of single editing operations and the target number of editing operations can be determined as the target leveling force, and then the terrain height parameters and the mean terrain height corresponding to the model vertices located in the target editing area are obtained, and the terrain height corresponding to the target editing area is adjusted based on the target leveling force, so that the height difference of the terrain height corresponding to the target editing area gradually becomes smaller, that is, the terrain height area corresponding to the target editing area is flattened.
[0084] In actual applications, the leveling force corresponding to a single editing operation is proportional to the terrain leveling speed of the target editing area; wherein, terrain leveling is used to indicate that the terrain heights between the model vertices located in the target editing area are the same. Specifically, the greater the leveling force corresponding to a single editing operation, the faster the terrain leveling speed of the target editing area. For example, when the leveling force is large, the user may perform one editing operation to level the terrain of the target editing area; when the leveling force is small, the user may perform multiple editing operations to level the terrain of the target editing area, thereby reducing the terrain leveling speed.
[0085] Furthermore, the specific process of adjusting the terrain height corresponding to the model vertex located in the target editing area based on the target leveling strength can be achieved through the following steps 20-21:
[0086] Step 20, determining the average height corresponding to the terrain height of the model vertices located in the target editing area.
[0087] In a specific implementation, the average height value corresponding to the target editing area may be determined according to the terrain heights of the model vertices in the target area.
[0088] Step 21, adjusting the terrain height corresponding to the model vertex located in the target editing area according to the average height and the target leveling strength.
[0089] Since the average height is the terrain height corresponding to the target editing area to be flattened, the terrain height of the target terrain area can be gradually or directly adjusted to the average height according to the average height and the target average strength.
[0090] In an optional embodiment, the above step 21 can be implemented by the following steps: 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. The above preset leveling force can usually be a value determined according to research and development needs. For example, the preset leveling force can be set to 1 or other values. When the target leveling force is the preset leveling force, the terrain height corresponding to the target editing area can be directly set to the average height, so that the target editing area is directly leveled. This method provides a one-click terrain leveling function.
[0091] In another optional embodiment, the above step 21 can also be implemented by the following steps: for each model vertex located in the target editing area, 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 strength, adjust the terrain height of the current model vertex to the average height; if the difference is not less than the target leveling strength, determine whether the terrain height of the current model vertex is higher than the average height, if higher, reduce the terrain height of the current model vertex by the height value corresponding to the target leveling strength; if not higher, increase the terrain height of the current model vertex by the height value corresponding to the target leveling strength. This method can gradually adjust the terrain height of the target editing area to the average height according to the size of the target leveling strength, so that the target editing area can gradually become flat, which is conducive to users setting terrain effects with different terrain flatness.
[0092] Furthermore, the user can also set the leveling force corresponding to a single editing operation in the following manner: responding to a trigger operation on the target terrain editing control, controlling the display of a second input control in the graphical user interface; responding to a second input operation on the second input control, determining the leveling force 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 research and development requirements.
[0093] like Figure 6 FIG. 1 is a schematic diagram of adjusting terrain flatness provided by an embodiment of the present disclosure. Figure 6 The graphical user interface is displayed when the user triggers the leveling control (equivalent to the target terrain editing control mentioned above). The "drawing strength" control in the graphical user interface is also the second input control mentioned above. The 0.5 in the value box in the second input control is the leveling strength corresponding to the current single editing operation. When adjusting the leveling strength, the user can click the value box in the second input control to call out the numeric keyboard, and then enter the target value in the value box based on the numeric keyboard, and determine the target value as the leveling strength 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 parameter includes 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, the material adjustment control will be displayed in the graphical user interface. Based on this, the target terrain material is determined in the following manner: in response to the triggering operation of the material adjustment control, multiple preset terrain materials are controlled to be displayed in the graphical user interface; in response to the selection operation of multiple preset terrain materials, the target terrain material is determined from multiple preset terrain materials based on the selection operation. The multiple preset terrain materials are set according to R&D 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 figure shows a schematic diagram of adjusting terrain material provided by the embodiment of the present disclosure. When a user clicks on a material control (equivalent to the above-mentioned target terrain editing control), a material adjustment control will be displayed in a graphical user interface. When a user clicks or long presses on 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, and use the target terrain material to switch to the material corresponding to the target editing area, and the panel will be automatically closed at the same time.
[0097] The above method supports setting the shape and size of the brush tool. Users can build surface material graphics or terrain of any shape, thereby increasing the richness of the terrain.
[0098] The following embodiments are used to describe the manner of saving and undoing an editing operation.
[0099] Specifically, 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. In specific implementation, when the user completes the second editing operation, triggering the save control will save the second editing operation and the operations before the second editing operation.
[0100] Furthermore, the above graphical user interface also includes an undo control and a restore 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 restore control is used to: restore the second editing operation after the second editing operation is undoed, 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 undoing the current editing operation, the user can also restore the current editing operation by triggering the restore control.
[0101] In the specific implementation, suppose the user first places a scene component in the scene editing mode (operation 1), then enters the terrain editing mode to modify 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, clicking the undo control will undo the modification of operation 3. Clicking the undo control again can undo the modification of operation 2. Clicking the undo control again can undo the modification of operation 1. If you click the restore control at this time, you can restore the modification of operation 1.
[0102] In the present disclosure, the save, undo, and restore operation stacks in the terrain editing mode are combined with the editing operations in the scene editing mode, that is, each step of terrain editing can be saved, undo, and restored at any time, thereby improving the efficiency of users in terrain adjustment.
[0103] Corresponding to the above method embodiment, the present disclosure also provides a terrain editing device, such as Figure 8 As shown, the device comprises:
[0104] The interface display module 90 is used to display a graphical user interface through a terminal device, wherein 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 used to control the generation of a terrain component corresponding to the terrain component control at the designated position in response to dragging the terrain component control to the designated position of the virtual editing scene.
[0106] The control display module 92 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 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 used to respond to a second editing operation on the terrain component after triggering a target terrain editing control among multiple 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 a virtual editing scene.
[0108] The above-mentioned 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 setting the position of the terrain components; at the same time, this method can adjust the height and material of the terrain components 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] Furthermore, the above-mentioned terrain component is a component model of a preset shape.
[0111] Furthermore, the control display module 92 is used to: respond to a selection operation on a terrain component, select the terrain component and display a first control in a graphical user interface; respond 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.
[0112] Furthermore, the above-mentioned device also includes a focusing module, which is used to: when multiple terrain editing controls for terrain components are displayed in the graphical user interface, control the virtual editing scene to enter the terrain editing mode, and focus on displaying the terrain components in the graphical user interface.
[0113] Furthermore, the graphical user interface also includes an exit control; based on this, the device also includes a focus cancellation module, which is used to: respond to a trigger operation on the exit control, control the virtual editing scene to exit the terrain editing mode, and cancel the focus display of the terrain component in the graphical user interface.
[0114] Furthermore, the above-mentioned device also includes a mobile control module, which is used to: in response to the virtual editing scene entering the terrain editing mode, control the display of the perspective control control in the graphical user interface; wherein the perspective 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 picture in the graphical user interface.
[0115] Furthermore, the above-mentioned component editing module 93 is used to: respond to a trigger operation on a target terrain editing control among multiple terrain editing controls, and control the display of a brush tool in a graphical user interface; respond to a second editing operation of the brush tool on the terrain component, determine a target editing area in the terrain component based on the second editing operation, and adjust the target editing area based on the editing function corresponding to the target terrain editing control.
[0116] In a specific implementation, the second editing operation includes: a click operation or a slide operation based on a brush tool acting on the terrain component.
[0117] Furthermore, the brush tool is an interactive tool with a specified shape and a specified size; based on this, the component editing module 93 is used to: determine the brush effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; determine the target editing area based on the brush effective range and the position of the second editing operation acting on the terrain component.
[0118] Furthermore, the above-mentioned device also includes a size adjustment module, which is used to: respond to a trigger operation on a target terrain editing control among multiple terrain editing controls, control the display of a brush size adjustment control in the graphical user interface; respond to a first adjustment operation on the brush size adjustment control, and adjust the size of the brush tool displayed in the graphical user interface based on the first adjustment operation.
[0119] Furthermore, the above-mentioned device also includes a shape adjustment module, which is used to: respond to a trigger operation on a target terrain editing control among multiple terrain editing controls, control the display of a brush shape adjustment control in the graphical user interface; respond to a second adjustment operation on the brush shape adjustment control, and adjust the shape of the brush tool displayed in the graphical user interface based on the second adjustment operation.
[0120] Furthermore, the above-mentioned terrain component includes: a component model formed by connecting multiple model vertices to each other, 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; based on this, the above-mentioned component editing module 93 is used to: based on the second editing operation, determine the target editing parameters that match the editing function corresponding to the target terrain editing control; 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.
[0121] In an optional embodiment, the editing function corresponding to the above-mentioned target terrain editing control includes adjusting the terrain height of the terrain component; based on this, the above-mentioned component editing module 93 is used to: determine the height adjustment value corresponding to a single editing operation, and determine the target number of editing operations corresponding to the second editing operation; determine the target adjustment height value based on the target number of editing operations and the height adjustment value corresponding to the single editing operation, and determine the target adjustment height value as the target editing parameter; determine the adjusted terrain height parameter corresponding to the target editing area according to the terrain height parameter currently corresponding to the model vertex located in the target editing area and the target adjustment height value.
[0122] Furthermore, the height adjustment value corresponding to the above-mentioned single editing operation includes a positive value or a negative value.
[0123] Furthermore, the above-mentioned device includes an altitude value adjustment module, which is used to: respond to a trigger operation on a target terrain editing control, control the display of a first input control in a graphical user interface; respond to a first input operation on the first input control, and determine the altitude adjustment value corresponding to a single editing operation based on the first input operation.
[0124] Furthermore, the editing function corresponding to the above-mentioned target terrain editing control includes adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate the difference in terrain height; based on this, the above-mentioned component editing module 93 is used to: determine the flattening force corresponding to a single editing operation, and determine the target number of editing operations corresponding to the second editing operation; based on the target number of editing operations and the flattening force corresponding to the single editing operation, determine the target flattening force, and determine the target flatness as the target editing parameter; the step of adjusting the terrain height of the model vertex located in the target editing area includes: adjusting the terrain height corresponding to the model vertex located in the target editing area based on the target flattening force.
[0125] Furthermore, the leveling force corresponding to a single editing operation is proportional to the terrain leveling speed of the target editing area; wherein terrain leveling is used to indicate that the terrain heights between model vertices located in the target editing area are the same.
[0126] Furthermore, the component editing module 92 is used to: determine the average height corresponding to the terrain height of the model vertices located in the target editing area; and adjust the terrain height corresponding to the model vertices located in the target editing area according to the average height and the target leveling strength.
[0127] Furthermore, the component editing module 92 is also used to: if the target leveling force is a preset leveling force, adjust the terrain height corresponding to the model vertex located in the target editing area to the average height.
[0128] Furthermore, the component editing module 92 is also used to perform the following operations for each model vertex located in the target editing area: 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 strength, adjust the terrain height of the current model vertex to the average height; if the difference is not less than the target leveling strength, 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 by the height value corresponding to the target leveling strength; if it is not higher, increase the terrain height of the current model vertex by the height value corresponding to the target leveling strength.
[0129] Furthermore, the above-mentioned device also includes a force adjustment module, which is used to: respond to a trigger operation on the target terrain editing control, control the display of a second input control in the graphical user interface; respond to a second input operation on the second input control, and determine the leveling force corresponding to a single editing operation based on the second input operation.
[0130] Furthermore, the editing function corresponding to the target terrain editing control includes adjusting the terrain material of the terrain component; the target editing parameters include the target terrain material; the 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 above-mentioned device also includes a material determination module, which is used to: respond to the trigger operation of the material adjustment control, control the display of multiple preset terrain materials in the graphical user interface; respond to the selection operation of multiple preset terrain materials, and determine the target terrain material from the multiple preset terrain materials based on the selection operation.
[0132] Furthermore, the above-mentioned device also includes a terrain editing module, which is used to: respond to the third editing operation on the terrain component and adjust the position and / or size of the terrain component in the virtual editing scene.
[0133] Furthermore, the above-mentioned 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.
[0134] Furthermore, the above-mentioned graphical user interface also includes an undo control and a restore control; the undo control is used to: undo the second editing operation and display the terrain components before editing based on the second editing operation in the virtual editing scene; the restore control is used to: restore the second editing operation after undoing the second editing operation, and display the adjusted terrain components edited based on the second editing operation in the virtual editing scene.
[0135] The terrain editing device provided in the embodiment of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0136] The present disclosure also provides an electronic device, such as Fig. 9 As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above terrain editing method.
[0137] Specifically, the terrain editing method comprises: displaying a graphical user interface through a terminal device, wherein the graphical user interface comprises 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 the generation of a terrain component corresponding to the terrain component control at a specified position of the virtual editing scene; controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface; wherein the multiple 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 triggering a target terrain editing control among the multiple terrain editing controls, acting on the terrain component with a second editing operation, 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.
[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 setting the position of the terrain components; at the same time, this method can adjust the height and material of the terrain components through the terrain editing control, thereby improving the richness of the terrain.
[0139] In an optional embodiment, the virtual editing scene includes 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 above-mentioned step of controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface includes: responding to a selection operation on the terrain component, selecting the terrain component and displaying a first control in the graphical user interface; responding to a triggering operation on the first control, controlling the display of multiple terrain editing controls corresponding to the selected terrain component in the graphical user interface.
[0142] In an optional embodiment, the method further includes: when displaying a plurality of terrain editing controls for a terrain component 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 also includes an exit control; the above method also includes: responding to a trigger operation on the exit control, controlling the virtual editing scene to exit the terrain editing mode, and canceling the focus on the displayed terrain component in the graphical user interface.
[0144] In an optional embodiment, the above method also includes: in response to the virtual editing scene entering the terrain editing mode, controlling the display of a perspective control control in the graphical user interface; wherein the perspective 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 picture in the graphical user interface.
[0145] In an optional embodiment, the above-mentioned step of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control in response to triggering a target terrain editing control among multiple terrain editing controls includes: controlling the display of a brush tool in a graphical user interface in response to the triggering operation for a target terrain editing control among multiple terrain editing controls; determining a target editing area in the terrain component based on the second editing operation in response to the second editing operation of the brush tool on the terrain component, 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 includes: a click operation or a slide operation based on a 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; the step of determining the target editing area in the terrain component based on the second editing operation includes: determining the brush effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; determining the target editing area based on the brush effective range and the position where the second editing operation acts on the terrain component.
[0148] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush size adjustment control in a graphical user interface; responding 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 above method also includes: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush shape adjustment control in a graphical user interface; responding 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 interconnecting a plurality of 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, determining a target editing parameter that matches the editing function corresponding to the target terrain editing control; based on the target editing parameter, adjusting the terrain height of the model vertex located in the target editing area, or adjusting the terrain material corresponding to the target editing area.
[0151] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain height 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: determining the height adjustment value corresponding to a single editing operation, and determining the target number of editing operations corresponding to a second editing operation; determining the target adjustment height value based on the target number of editing operations and the height adjustment value corresponding to the single editing operation, and determining the target adjustment height value as the target editing parameter; based on the target editing parameter, the step of adjusting the height parameters of the vertices corresponding to the target editing area includes: determining the adjusted terrain height parameters corresponding to the target editing area according to the terrain height parameters currently corresponding to the model vertices located in the target editing area and the target adjustment height value.
[0152] In an optional embodiment, the height adjustment value corresponding to the above-mentioned single editing operation includes a positive value or a negative value.
[0153] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control, controlling the display of a first input control in a graphical user interface; responding to a first input operation on the first input control, determining a height adjustment value corresponding to a single editing operation based on the first input operation.
[0154] In an optional embodiment, the editing function corresponding to the above-mentioned target terrain editing control includes adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate the difference in terrain height; based on the second editing operation, the step of determining the target editing parameter that matches the editing function corresponding to the target terrain editing control includes: determining the flattening force corresponding to a single editing operation, and determining the target number of edits corresponding to the second editing operation; determining the target flattening force based on the target number of edits and the flattening force corresponding to the single editing operation, and determining the target flatness as the target editing parameter; the step of adjusting the terrain height of the model vertex located in the target editing area includes: adjusting the terrain height corresponding to the model vertex located in the target editing area based on the target flattening force.
[0155] In an optional embodiment, the leveling force corresponding to the above-mentioned single editing operation is proportional to the terrain leveling speed of the target editing area; wherein terrain leveling is used to indicate that the terrain heights between the model vertices located in the target editing area are the same.
[0156] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertices located in the target editing area based on the target leveling force includes: determining the average height corresponding to the terrain height of the model vertices located in the target editing area; and adjusting the terrain height corresponding to the model vertices located in the target editing area according to the average height and the target leveling force.
[0157] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertices located in the target editing area according to the average height and the target leveling force includes: if the target leveling force is a preset leveling force, adjusting the terrain height corresponding to the model vertices located in the target editing area to the average height.
[0158] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing area according to the average height and the target leveling strength includes: for each model vertex located in the target editing area, performing the following operations: determining the difference between the terrain height of the current model vertex and the average height; if the difference is less than the target leveling strength, adjusting the terrain height of the current model vertex to the average height; if the difference is not less than the target leveling strength, determining whether the terrain height of the current model vertex is higher than the average height; if so, reducing the terrain height of the current model vertex by the height value corresponding to the target leveling strength; if not, increasing the terrain height of the current model vertex by the height value corresponding to the target leveling strength.
[0159] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control, controlling the display of a second input control in a graphical user interface; responding to a second input operation on the second input control, determining a leveling force corresponding to a single editing operation based on the second input operation.
[0160] In an optional embodiment, the editing function corresponding to the above-mentioned target terrain editing control includes 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: switching the terrain material of the target editing area to the target terrain material.
[0161] In an optional embodiment, when a target terrain editing control is triggered, a material adjustment control is displayed in a graphical user interface; the target terrain material is determined in the following manner: in response to a trigger operation on the material adjustment control, a plurality of preset terrain materials are displayed in the graphical user interface; in response to a selection operation on a 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 above-mentioned graphical user interface also includes an undo control and a restore 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 restore control is used to: restore the second editing operation after undoing the second editing operation, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene.
[0165] Further, Fig. 9 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0166] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0167] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0168] The embodiment of the present disclosure also provides 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 prompt the processor to implement the above-mentioned terrain editing method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0169] Specifically, the terrain editing method comprises: displaying a graphical user interface through a terminal device, wherein the graphical user interface comprises 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 the generation of a terrain component corresponding to the terrain component control at a specified position of the virtual editing scene; controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface; wherein the multiple 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 triggering a target terrain editing control among the multiple terrain editing controls, acting on the terrain component with a second editing operation, 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.
[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 setting the position of the terrain components; at the same time, this method can adjust the height and material of the terrain components through the terrain editing control, thereby improving the richness of the terrain.
[0171] In an optional embodiment, the virtual editing scene includes 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 above-mentioned step of controlling the display of multiple terrain editing controls for the terrain component in the graphical user interface includes: responding to a selection operation on the terrain component, selecting the terrain component and displaying a first control in the graphical user interface; responding to a triggering operation on the first control, controlling the display of multiple terrain editing controls corresponding to the selected terrain component in the graphical user interface.
[0174] In an optional embodiment, the method further includes: when displaying a plurality of terrain editing controls for a terrain component 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 also includes an exit control; the above method also includes: responding to a trigger operation on the exit control, controlling the virtual editing scene to exit the terrain editing mode, and canceling the focus on the displayed terrain component in the graphical user interface.
[0176] In an optional embodiment, the above method also includes: in response to the virtual editing scene entering the terrain editing mode, controlling the display of a perspective control control in the graphical user interface; wherein the perspective 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 picture in the graphical user interface.
[0177] In an optional embodiment, the above-mentioned step of adjusting the terrain component based on the second editing operation and the editing function corresponding to the target terrain editing control in response to triggering a target terrain editing control among multiple terrain editing controls includes: controlling the display of a brush tool in a graphical user interface in response to the triggering operation for a target terrain editing control among multiple terrain editing controls; determining a target editing area in the terrain component based on the second editing operation in response to the second editing operation of the brush tool on the terrain component, 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 includes: a click operation or a slide operation based on a 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; the step of determining the target editing area in the terrain component based on the second editing operation includes: determining the brush effective range corresponding to the brush tool based on the specified shape and the specified size corresponding to the brush tool; determining the target editing area based on the brush effective range and the position where the second editing operation acts on the terrain component.
[0180] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush size adjustment control in a graphical user interface; responding 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 above method also includes: responding to a trigger operation on a target terrain editing control among multiple terrain editing controls, controlling the display of a brush shape adjustment control in a graphical user interface; responding 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 interconnecting a plurality of 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, determining a target editing parameter that matches the editing function corresponding to the target terrain editing control; based on the target editing parameter, adjusting the terrain height of the model vertex located in the target editing area, or adjusting the terrain material corresponding to the target editing area.
[0183] In an optional embodiment, the editing function corresponding to the target terrain editing control includes adjusting the terrain height 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: determining the height adjustment value corresponding to a single editing operation, and determining the target number of editing operations corresponding to a second editing operation; determining the target adjustment height value based on the target number of editing operations and the height adjustment value corresponding to the single editing operation, and determining the target adjustment height value as the target editing parameter; based on the target editing parameter, the step of adjusting the height parameters of the vertices corresponding to the target editing area includes: determining the adjusted terrain height parameters corresponding to the target editing area according to the terrain height parameters currently corresponding to the model vertices located in the target editing area and the target adjustment height value.
[0184] In an optional embodiment, the height adjustment value corresponding to the above-mentioned single editing operation includes a positive value or a negative value.
[0185] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control, controlling the display of a first input control in a graphical user interface; responding to a first input operation on the first input control, determining a height adjustment value corresponding to a single editing operation based on the first input operation.
[0186] In an optional embodiment, the editing function corresponding to the above-mentioned target terrain editing control includes adjusting the terrain flatness of the terrain component; the terrain flatness is used to indicate the difference in terrain height; based on the second editing operation, the step of determining the target editing parameter that matches the editing function corresponding to the target terrain editing control includes: determining the flattening force corresponding to a single editing operation, and determining the target number of edits corresponding to the second editing operation; determining the target flattening force based on the target number of edits and the flattening force corresponding to the single editing operation, and determining the target flatness as the target editing parameter; the step of adjusting the terrain height of the model vertex located in the target editing area includes: adjusting the terrain height corresponding to the model vertex located in the target editing area based on the target flattening force.
[0187] In an optional embodiment, the leveling force corresponding to the above-mentioned single editing operation is proportional to the terrain leveling speed of the target editing area; wherein terrain leveling is used to indicate that the terrain heights between the model vertices located in the target editing area are the same.
[0188] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertices located in the target editing area based on the target leveling force includes: determining the average height corresponding to the terrain height of the model vertices located in the target editing area; and adjusting the terrain height corresponding to the model vertices located in the target editing area according to the average height and the target leveling force.
[0189] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertices located in the target editing area according to the average height and the target leveling force includes: if the target leveling force is a preset leveling force, adjusting the terrain height corresponding to the model vertices located in the target editing area to the average height.
[0190] In an optional embodiment, the step of adjusting the terrain height corresponding to the model vertex located in the target editing area according to the average height and the target leveling strength includes: for each model vertex located in the target editing area, performing the following operations: determining the difference between the terrain height of the current model vertex and the average height; if the difference is less than the target leveling strength, adjusting the terrain height of the current model vertex to the average height; if the difference is not less than the target leveling strength, determining whether the terrain height of the current model vertex is higher than the average height; if so, reducing the terrain height of the current model vertex by the height value corresponding to the target leveling strength; if not, increasing the terrain height of the current model vertex by the height value corresponding to the target leveling strength.
[0191] In an optional embodiment, the above method also includes: responding to a trigger operation on a target terrain editing control, controlling the display of a second input control in a graphical user interface; responding to a second input operation on the second input control, determining a leveling force corresponding to a single editing operation based on the second input operation.
[0192] In an optional embodiment, the editing function corresponding to the above-mentioned target terrain editing control includes 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: switching the terrain material of the target editing area to the target terrain material.
[0193] In an optional embodiment, when a target terrain editing control is triggered, a material adjustment control is displayed in a graphical user interface; the target terrain material is determined in the following manner: in response to a trigger operation on the material adjustment control, a plurality of preset terrain materials are displayed in the graphical user interface; in response to a selection operation on a 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 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.
[0195] 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.
[0196] In an optional embodiment, the above-mentioned graphical user interface also includes an undo control and a restore 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 restore control is used to: restore the second editing operation after undoing the second editing operation, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene.
[0197] If the method is implemented in the form of a software unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0198] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0199] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A terrain editing method, characterized in that: The method comprises: Displaying a graphical user interface through a terminal device, wherein the graphical user interface includes 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 generation of a terrain component corresponding to the terrain component control at a designated position of the virtual editing scene; Controlling display of 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; In response to triggering a target terrain editing control among the multiple 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 an editing function corresponding to the target terrain editing control, and the adjusted terrain component is displayed in the virtual editing scene.
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 of a preset shape.
4. The method according to claim 1, characterized in that: The step of controlling the display of a plurality of terrain editing controls for the terrain component in the graphical user interface comprises: 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 triggering operation on the first control, a plurality of terrain editing controls corresponding to the selected terrain component are controlled to be displayed in the graphical user interface.
5. The method according to claim 1 or 4, characterized in that: The method further comprises: When a plurality of terrain editing controls for the terrain component are displayed in the graphical user interface, the virtual editing scene is controlled to enter a terrain editing mode, and the terrain component is displayed in a focused manner 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 also includes: In response to a trigger operation on the exit control, the virtual editing scene is controlled to exit the terrain editing mode, and the terrain component is defocused and displayed in the graphical user interface.
7. The method according to claim 5, characterized in that The method further comprises: In response to the virtual editing scene entering the terrain editing mode, a perspective control control is controlled to be displayed in the graphical user interface; wherein the perspective 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 screen in the graphical user interface.
8. The method according to claim 1, characterized in that: The step of acting on the terrain component in response to triggering a target terrain editing control among the multiple terrain editing controls, and adjusting the terrain component based on the second editing operation and an editing function corresponding to the target terrain editing control, comprises: In response to a trigger operation on a target terrain editing control among the plurality of terrain editing controls, controlling display of a brush tool in the graphical user interface; In response to a second editing operation of the brush tool on the terrain component, a target editing area is determined in the terrain component based on the second editing operation, and the target editing area is adjusted based on an editing function corresponding to the target terrain editing control.
9. The method according to claim 8, characterized in that The second editing operation includes: a click operation or a slide operation based on the brush tool acting on the terrain component.
10. The method according to claim 8, characterized in that The brush tool is an interactive tool with a specified shape and a specified size; The step of determining a target editing area in the terrain component based on the second editing operation comprises: Determine a brush effective range corresponding to the brush tool based on a specified shape and a specified size corresponding to the brush tool; The target editing area is determined based on the brush effective range and the position where the second editing operation acts on the terrain component.
11. The method according to claim 10, characterized in that The method further comprises: In response to a trigger operation on a target terrain editing control among the plurality of terrain editing controls, controlling 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.
12. The method according to claim 10, characterized in that The method further comprises: In response to a trigger operation on a target terrain editing control among the plurality of terrain editing controls, controlling 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.
13. The method according to claim 8, characterized in that The terrain component includes: a component model formed by connecting a plurality of model vertices to each other, 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, determining a target editing parameter that matches the editing function corresponding to the target terrain editing control; Based on the target editing parameters, the terrain height of the model vertex located in the target editing area is adjusted, or the terrain material corresponding to the target editing area is adjusted.
14. The method according to claim 13, characterized in that The editing function corresponding to the target terrain editing control includes adjusting the terrain height 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: Determining a height adjustment value corresponding to a single editing operation, and determining a target number of editing times corresponding to the second editing operation; Determine a target adjustment height value based on the target number of edits and the height adjustment value corresponding to the single edit operation, and determine the target adjustment height value as the target edit parameter; The step of adjusting the height parameters of the vertices corresponding to the target editing area based on the target editing parameters includes: The adjusted terrain height parameter corresponding to the target editing area is determined according to the terrain height parameter currently corresponding to the model vertex located in the target editing area and the target adjusted height value.
15. The method according to claim 14, characterized in that The height adjustment value corresponding to the single editing operation includes a positive value or a negative value.
16. The method according to claim 14, characterized in that The method further comprises: In response to a trigger operation on the target terrain editing control, controlling display of a first input control in the graphical user interface; In response to a first input operation directed to the first input control, a height adjustment value corresponding to a single editing operation is determined based on the first input operation.
17. The method according to claim 13, characterized in that 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 the difference in terrain height; The step of determining, based on the second editing operation, a target editing parameter that matches the editing function corresponding to the target terrain editing control comprises: Determining a smoothing intensity corresponding to a single editing operation, and determining a target number of editing times corresponding to the second editing operation; Determine a target smoothing intensity based on the target number of edits and the smoothing intensity corresponding to the single edit operation, and determine the target smoothing degree 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 leveling strength.
18. The method according to claim 17, characterized in that The leveling force corresponding to the 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 heights between the model vertices located in the target editing area are the same.
19. The method according to claim 17, characterized in that The step of adjusting the terrain height corresponding to the model vertex located in the target editing area based on the target leveling strength includes: Determine the average height of the terrain heights corresponding to the model vertices located in the target editing area; The terrain height corresponding to the model vertex located in the target editing area is adjusted according to the height average value and the target leveling strength.
20. The method according to claim 19, characterized in that The step of adjusting the terrain height corresponding to the model vertex located in the target editing area according to the height average value and the target leveling strength 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.
21. The method according to claim 19, characterized in that The step of adjusting the terrain height corresponding to the model vertex located in the target editing area according to the height average value and the target leveling strength includes: For each model vertex located in the target editing area, perform the following operations: Determine the difference between the terrain height of the current model vertex and the average value of the height; If the difference is less than the target leveling strength, adjusting the terrain height of the current model vertex to the average height; If the difference is not less than the target leveling force, determining whether the terrain height of the current model vertex is higher than the average height, and if higher, reducing the terrain height of the current model vertex by the height value corresponding to the target leveling force; If not, the terrain height of the current model vertex is increased by the height value corresponding to the target leveling force.
22. The method according to claim 17, characterized in that The method further comprises: In response to a trigger operation on the target terrain editing control, controlling display of a second input control in the graphical user interface; In response to a second input operation directed to the second input control, a smoothing force corresponding to the single editing operation is determined based on the second input operation.
23. The method according to claim 13, characterized in that The editing function corresponding to the target terrain editing control includes adjusting the terrain material of the terrain component; the target editing parameter includes 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.
24. The method according to claim 23, characterized in that When the target terrain editing control is triggered, displaying a material adjustment control in the graphical user interface; The target terrain material is determined in the following way: In response to a triggering operation on the material adjustment control, controlling display of a plurality of preset terrain materials in the graphical user interface; In response to a selection operation on the plurality of preset terrain materials, a target terrain material is determined from the plurality of preset terrain materials based on the selection operation.
25. The method according to claim 1, characterized in that The method further comprises: In response to a third editing operation on the terrain component, a position and / or size of the terrain component in the virtual editing scene is adjusted.
26. 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.
27. The method according to claim 1, characterized in that The graphical user interface also includes an undo control and a restore 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 restore control is used to: restore the second editing operation after undoing the second editing operation, and display the adjusted terrain component edited based on the second editing operation in the virtual editing scene.
28. A terrain editing device, characterized in that: The device comprises: An interface display module, used for displaying a graphical user interface through a terminal device, wherein the graphical user interface includes a virtual editing scene and a component creation window; wherein the component creation window includes a terrain component control; A component generation module, configured to control generation of a terrain component corresponding to the terrain component control at a designated position in response to dragging the terrain component control to the designated position of the virtual editing scene; A control display module, used for controlling the display of 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; A component editing module is used to respond to a second editing operation performed on the terrain component after a target terrain editing control among the multiple 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.
29. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the terrain editing method described in any one of claims 1 to 27.
30. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the terrain editing method described in any one of claims 1 to 27.
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
Terrain editing method and device, terminal and storage medium
CN115445206A
Virtual terrain generation method and device and electronic equipment
CN118045351A
Interactive control method and apparatus in game and electronic device
WO2024212395A1