Virtual scene construction method and device, electronic equipment and storage medium
Through the mapping relationship between the feature map input by the user and the virtual scene topographic map, the distribution weight of virtual objects in the virtual scene is determined, which solves the problem of low efficiency in virtual scene construction in the existing technology, and realizes the rapid construction of virtual scenes that meet the needs.
Patent Information
- Application Number
- CN202510013164.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-11
AI Technical Summary
The construction of virtual scenes in the prior art is less efficient, especially when it contains complex virtual objects and topographic maps.
Through the mapping relationship between the first feature map input by the user and the topographic map of the virtual scene, the weights of the virtual objects distributed by each vertex in the topographic map are determined, and the distribution position of the virtual object model in the topographic map is set according to these weights.
It realizes the rapid construction of virtual scenes that meet the requirements based on user needs, and improves the efficiency of virtual scene construction.
Smart Images

Figure CN119792941A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and more specifically, to a method, device, electronic device and storage medium for constructing a virtual scene. Background Art
[0002] With the rapid development of the gaming industry, virtual scenes, as an important part of games, provide users with a virtual space for exploration, interaction and challenge. At present, in order to create a more realistic virtual scene, the virtual scene needs to include virtual objects such as vegetation, rivers, mountains and roads. The construction of virtual scenes is relatively complex, which makes the efficiency of building virtual scenes low. Summary of the invention
[0003] One purpose of the embodiments of the present disclosure is to provide a new technical solution for constructing a virtual scene.
[0004] According to a first aspect of the present disclosure, a method for constructing a virtual scene is provided, the method comprising:
[0005] Based on a first input from a user, determining a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene;
[0006] Based on the first feature map input by the user, determining a mapping relationship between the first feature map and the first plane of the topographic map; wherein the first pixel point of the first feature map is configured with a first feature value, and the first feature value is used to reflect the weight of the first virtual object distributed by the first pixel point;
[0007] According to the mapping relationship and the first eigenvalue of the first pixel point, a second eigenvalue of a first vertex of the topographic map is obtained; wherein the second eigenvalue is used to reflect the weight of the first virtual object distributed at the first vertex;
[0008] The distribution position of the first model in the topographic map is set according to the second eigenvalue of the first vertex.
[0009] In a possible implementation, determining a first model of the first virtual object displayed in a virtual scene and a topographic map of the virtual scene includes:
[0010] Determine a first model of a first virtual object displayed in a virtual scene based on a first parameter in a first input by a user;
[0011] Based on the second parameter in the first input of the user, the height value of the height field of the virtual scene is adjusted to obtain a topographic map of the virtual scene.
[0012] In a possible implementation, determining a first model of the first virtual object displayed in the virtual scene based on a first parameter value of a first parameter in a first input by a user includes:
[0013] Determine, based on a first parameter value of a first parameter in a first input by a user, a first component of a second model common to the first virtual object and a group file of the first component;
[0014] According to a first parameter value of the first parameter, setting a first attribute value in the group file;
[0015] Setting a first scaling value in the group file based on a scene size ratio set for the virtual scene;
[0016] Based on the first attribute value and the first scaling value, the second model is controlled to be updated to a first model of the first virtual object displayed in the virtual scene.
[0017] In a possible implementation, the second parameter includes a second attribute of a second pixel in the height map; and adjusting the height value of the height field of the virtual scene based on the second parameter in the first input of the user to obtain the topographic map of the virtual scene includes:
[0018] Determine, based on a second attribute of a second pixel point in the height map, a second vertex of the height field of the virtual scene corresponding to the second pixel point;
[0019] The second attribute is mapped to the second vertex to obtain a terrain map.
[0020] In a possible implementation, the first feature map is a grayscale map, and the first feature value of the first pixel is a grayscale value; wherein the grayscale value is used to measure the weight of the first virtual object distributed by the first pixel.
[0021] In a possible implementation, the first plane of the topographic map includes a first plane area of a first surface type and a second plane area of a second surface type, the second eigenvalue of the first vertex located in the first plane area is a fixed value, and the second eigenvalue of the first vertex located in the second plane area is related to a first distance value; wherein the first distance value is the distance value between the first vertex located in the first plane area and the nearest first vertex located in the second plane area.
[0022] In a possible implementation, the virtual scene sets a third model of the second virtual object in the first position area; and the method further includes:
[0023] In response to the user's instruction to display the virtual scene, it is displayed that the first model is located at the distribution position of the topographic map and the second virtual object is located at the first position area of the topographic map.
[0024] According to a second aspect of the present disclosure, a device for constructing a virtual scene is also provided, the device comprising:
[0025] A first determining module, configured to determine a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene based on a first input from a user;
[0026] A second determination module is configured to determine a mapping relationship between the first feature map and the first plane of the topographic map based on the first feature map input by the user; wherein the first pixel point of the first feature map is configured with a first feature value, and the first feature value is used to reflect the weight of the first virtual object distributed by the first pixel point;
[0027] An obtaining module, used for obtaining a second eigenvalue of a first vertex of the topographic map according to the mapping relationship and the first eigenvalue of the first pixel; wherein the second eigenvalue is used to reflect the weight of the first virtual object distributed at the first vertex;
[0028] A setting module is used to set the distribution position of the first model in the topographic map according to the second eigenvalue of the first vertex.
[0029] According to a third aspect of the present disclosure, a computer system is also provided, the computer system includes a processor, when the processor executes a program instruction or code, the computer system implements the game scene control method in the first aspect. Exemplarily, the computer system also includes a memory, the memory is used to store the program instruction or code.
[0030] According to a fourth aspect of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned virtual scene construction method when running.
[0031] According to a fifth aspect of the present disclosure, there is also provided a computer program product, comprising a game program, wherein when the game program is executed, the computer executes the steps of the above-mentioned method for constructing a virtual scene.
[0032] According to a sixth aspect of the present disclosure, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the virtual scene construction method through the computer program.
[0033] A beneficial effect of the embodiments of the present disclosure is that the method for constructing a virtual scene provided by the embodiments of the present disclosure can determine, based on the user's first input, a first model of a first object displayed in the virtual scene and a topographic map of the virtual scene, and, according to a mapping relationship between a first feature map and a first plane of the topographic map, determine the weights of the first virtual objects distributed at each first vertex in the topographic map, so as to set a number of first models in the topographic map according to user needs, so as to enable the user to quickly construct a virtual scene that meets the needs, thereby improving the efficiency of constructing the virtual scene.
[0034] Features and advantages of the embodiments of the present specification will become apparent from the following detailed description of exemplary embodiments of the present specification with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the specification and, together with the description, serve to explain the principles of the embodiments of the specification.
[0036] Figure 1 A schematic diagram of the hardware structure of an electronic device that can be used to implement the method for constructing a virtual scene according to an embodiment of the present disclosure is shown;
[0037] Figure 2 A schematic diagram showing a flow chart of a method for constructing a virtual scene according to some embodiments;
[0038] Figure 3 A schematic diagram showing a first characteristic graph according to some embodiments;
[0039] Figure 4 A schematic diagram of a constructed virtual scene according to some embodiments is shown;
[0040] Figure 5 A schematic structural diagram of a device for constructing a virtual scene according to some embodiments is shown;
[0041] Figure 6 A schematic diagram of the hardware structure of an electronic device according to some embodiments is shown. DETAILED DESCRIPTION
[0042] Various exemplary embodiments of the present specification will now be described in detail with reference to the accompanying drawings.
[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the embodiments of the present specification and its application or uses.
[0044] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0045] It should be noted that all actions of acquiring signals, information or data in the embodiments of the present disclosure are performed in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
[0046] The disclosed embodiment provides a new virtual scene construction scheme, which allows the user to input simple debugging parameters to adjust the number, placement, model size and other features of a virtual object in the virtual scene and the topographic map of the virtual scene. Then, the distribution of the virtual object in the virtual scene is set based on the first feature map input by the user regarding the distribution of the virtual object, so as to construct a virtual scene that meets the user's needs, effectively improving the efficiency of constructing the virtual scene.
[0047] Figure 1 A schematic diagram of the hardware structure of an electronic device that can be used to implement the method for constructing a virtual scene according to an embodiment of the present disclosure is shown.
[0048] The electronic device 1000 is a device capable of running games, i.e., a game client. The game may be a local application installed on the electronic device, or a web game, a light application, or a small program, etc., which is not limited here. The electronic device 1000 may be a mobile phone, a tablet computer, a PC, etc., which is not limited here.
[0049] like Figure 1 As shown, the electronic device 1000 may include a processor 1101, a memory 1102, an interface device 1103, a communication device 1104, an output device 1105, an input device 1106, and the like. Figure 1 The hardware configuration shown is merely illustrative and is in no way intended to limit the present disclosure, its application, or uses.
[0050] The processor 1101 is used to execute a computer program, which can be written in an instruction set of an architecture such as x86, Arm, RISC, MIPS, SSE, etc. The memory 1102 includes, for example, ROM (read-only memory), RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1103 includes, for example, a USB interface, a network cable interface, a headphone interface, etc. The communication device 1104 is capable of wired or wireless communication, for example, and the communication device 1104 may include at least one short-range communication module, for example, any module for short-range wireless communication based on short-range wireless communication protocols such as Hilink protocol, WiFi (IEEE 802.11 protocol), Mesh, Bluetooth, ZigBee, Thread, Z-Wave, NFC, UWB, LiFi, etc. The communication device 1104 may also include a remote communication module, for example, any module for WLAN, GPRS, 2G / 3G / 4G / 5G remote communication. The output device 1105 may include, for example, a liquid crystal display or a touch display, a speaker, etc. The input device 1106 may include, for example, a touch screen, a keyboard, a microphone, various sensors, etc.
[0051] In this embodiment, the memory 1102 of the electronic device 1000 is used to store a computer program, and the computer program is used to control the processor 1101 to operate so as to execute the method for constructing a virtual scene according to any embodiment of the present disclosure.
[0052] Next, Figure 1 Taking the electronic device 1000 as an example of the implementation subject, various embodiments of the method for constructing a virtual scene are explained.
[0053] <First Embodiment>
[0054] Figure 2 A method for constructing a virtual scene according to some embodiments is shown. The method for constructing a virtual scene may include the following steps S210 to S240:
[0055] Step S210: determining a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene based on a first input from a user.
[0056] In this embodiment, the virtual scene can be constructed based on three-dimensional computer image software such as Houdini, Maya, Cinema 4D, etc.
[0057] In this embodiment, the first virtual object is, for example, a tree, a building, a pickable object, etc., which is not limited here.
[0058] In this embodiment, the construction of the terrain map of the virtual scene is based on a preset first terrain file, and the first terrain file is provided with a plurality of terrain nodes, and the plurality of terrain nodes include a first terrain node, a second terrain node, a third terrain node, a fourth terrain node, a fifth terrain node and a sixth terrain node. Among them, the first terrain node is used to create a height field of the virtual scene, and the second terrain node is used to import the height map of the virtual scene to generate a terrain map. The third terrain node is used to adjust the height map to enrich the details of the terrain map. The fourth terrain node is used to remap the height field, adjust the mapping range of the height map, and enhance the visual effect of the height direction of the virtual scene. The fifth terrain node is used to add noise to the height field and increase the terrain details. The sixth terrain node is used to increase the visual effect of the naturally eroded and weathered terrain based on a preset erosion calculation algorithm.
[0059] Step S220, based on the first feature map input by the user, determine the mapping relationship between the first feature map and the first plane of the topographic map; wherein the first pixel point of the first feature map is configured with a first eigenvalue, and the first eigenvalue is used to reflect the weight of the first virtual object distributed at the first pixel point.
[0060] In this embodiment, the first plane of the topographic map may be a corresponding horizontal plane, that is, an xz plane in an xyz three-dimensional coordinate system. Each vertex on the first plane of the topographic map may correspond to a pixel point on the first feature map, that is, by scaling the first feature map, the mapping relationship between the first feature map and the first plane of the topographic map may be determined.
[0061] In some embodiments, in order to improve the efficiency of determining the distribution position of the first virtual object, the first feature map can be a grayscale map, and the first feature value of the first pixel is a grayscale value; wherein the grayscale value is used to measure the weight of the first virtual object distributed at the first pixel.
[0062] In some examples, such as Figure 3 In the first feature map shown, the first virtual object is a tree. Through the first feature map, it can be determined that the grayscale value of the first pixel point in the area close to the river R1 tends to 255, the grayscale value of the first pixel point in the area far from the river R1 tends to 0, and the grayscale value of the first pixel point in the area within the river R1 is 255. In other words, the grayscale map can effectively reflect the density of the first virtual object distributed at each first pixel point in the first feature map, effectively improving the efficiency of determining the distribution position of the first virtual object.
[0063] Step S230, obtaining a second eigenvalue of a first vertex of the topographic map according to the mapping relationship and the first eigenvalue of the first pixel; wherein the second eigenvalue is used to reflect the weight of the first virtual object distributed at the first vertex.
[0064] In this embodiment, when each vertex on the first plane of the topographic map can correspond to a pixel point on the first feature map, the second feature value of the first vertex of the topographic map can be determined.
[0065] Step S240: setting the distribution position of the first model in the topographic map according to the second eigenvalue of the first vertex.
[0066] In this embodiment, the first model is set in the topographic map after the first object file and the first terrain file are configured, and then processed by the first processing node, the second processing node, the third processing node and the fourth processing node. Among them, the first processing node heightfield_file1 is used to import the first feature map, and the user can actively adjust the color value of the first pixel on the first feature map to adjust the density distribution of the first virtual object in the virtual scene. The second processing node heightfield_maskexpand1 is used to parameterize the contraction or expansion range of the density map and control the baseline for vegetation generation. The third processing node heightfield_layer1 is used to scatter points on the height field in the virtual scene according to the first feature map. The fourth processing node is used to copy the first model of the first virtual object to the points scattered by the third processing node.
[0067] In some embodiments, in order to ensure that the constructed virtual scene meets user needs, the first plane of the topographic map includes a first plane area of the first surface type and a second plane area of the second surface type, the second eigenvalue of the first vertex located in the first plane area is a fixed value, and the second eigenvalue of the first vertex located in the second plane area is related to the first distance value; wherein the first distance value is the distance value between the first vertex located in the first plane area and the nearest first vertex located in the second plane area.
[0068] In some examples, such as Figure 3 In the first feature map shown, the first virtual object is a tree, the first surface type is, for example, a water surface type, and the second surface type is, for example, a ground surface type. Through the first feature map, it can be determined that the grayscale value of the first pixel point in the area close to the river R1 tends to 255, the grayscale value of the first pixel point in the area far from the river R1 tends to 0, and the grayscale value of the first pixel point in the area within the river R1 is 255.
[0069] The method for constructing a virtual scene according to the first embodiment of the present invention solves the problem of low efficiency in constructing a relatively complex virtual scene in the prior art. Based on this method, the first model displayed by the first object in the virtual scene and the topographic map of the virtual scene can be determined based on the first input of the user, and the weight of the first virtual object distributed at each first vertex in the topographic map can be determined based on the mapping relationship between the first feature map and the first plane of the topographic map, so as to set several first models in the topographic map according to the user's needs, so as to enable the user to quickly construct a virtual scene that meets the needs and improve the efficiency of constructing the virtual scene.
[0070] <Second Embodiment>
[0071] In this embodiment, in order to improve the flexibility of using virtual object resources and terrain map resources, the first virtual object and the terrain map can be adjusted by different parameters.
[0072] In these embodiments, relative to the first embodiment, step S210 may include the following steps S310 and S320:
[0073] Step S310: determining a first model of a first virtual object displayed in a virtual scene based on a first parameter in a first input of a user.
[0074] In some examples, the first parameter may include size information, color information of the first virtual object, size information of a first part of the first virtual object, and color information of the first part of the first virtual object, wherein the first part may be one or more parts of the first virtual object.
[0075] Step S320: Based on the second parameter in the first input of the user, adjust the height value of the height field of the virtual scene to obtain a topographic map of the virtual scene.
[0076] In some examples, the second parameter may be a height map, in which the color value of each pixel in the height map can reflect the height of the second vertex corresponding to the height field, and then the height of each second vertex of the height field is determined according to the color value of each pixel in the height map to obtain a three-dimensional terrain map.
[0077] <Third Embodiment>
[0078] In this embodiment, in order to construct the first model adapted to the virtual scene, the first virtual object is adjusted to the first model adapted to the virtual scene through the second model common to the first virtual object according to the scene size ratio set for the virtual scene.
[0079] In these embodiments, relative to the above second embodiment, step S310 may include the following steps S410 to S440:
[0080] Step S410 : determining a first component of a second model common to first virtual objects and a group file of the first component based on a first parameter value of a first parameter in a first input by a user.
[0081] Step S420: setting a first attribute value in the group file according to a first parameter value of the first parameter.
[0082] Step S430: Setting a first scaling value in the group file based on the scene size ratio set for the virtual scene.
[0083] Step S440: Based on the first attribute value and the first scaling value, the second model is controlled to be updated to the first model of the first virtual object displayed in the virtual scene.
[0084] In this embodiment, the construction of the first virtual object is based on a preset first object file, and the first object file is provided with a plurality of object nodes, and the plurality of object nodes may include a first object node, a second object node, a third object node, a fourth object node, a fifth object node, and a sixth object node. Among them, the first object node is used to import the model file of the first virtual object, that is, the general second model. The second object node is used to delete the redundant attributes of the first virtual object and retain the name attribute. The third object node is used to select the first component corresponding to the first virtual object according to the name attribute name of the surface level and group it as group1, and generate a group file of the first component. The fourth object node is used to color the group1 group according to the color reflected by the first parameter value of the first parameter. The fifth object node is used to adjust the first scaling value in the group file to match the scene size ratio set by the virtual scene. The sixth object node is used to perform asset packaging on the first virtual object. Among them, when the first virtual object has multiple parts, the first object file has a third object node and a fourth object node corresponding to the number of the multiple parts.
[0085] In some examples, taking the first virtual object as a tree as an example, the multiple components of the first virtual object include a leaf part, a trunk part, and a moss part. The first object node file1 imports the model file of the tree. The second object node attribdelete1 deletes redundant attributes and retains the name attribute. The third object node group1 selects the leaf part and groups it as leaf according to the name attribute leaf at the surface level. The third object node group2 selects the trunk part and groups it as trunk according to the name attribute trunk at the surface level. The third object node group3 selects the moss part and groups it as moss according to the name attribute moss at the surface level. The fourth object node color2 colors the leaf group. The fourth object node color3 colors the trunk group. The fourth object node color4 colors the moss group. The fifth object node transform1 adjusts the model scaling value to match the scene ratio. The sixth object node pack2 performs asset packaging on the tree.
[0086] <Fourth Embodiment>
[0087] In this embodiment, in order to construct a topographic map of a virtual scene to produce a three-dimensional visual effect, the color value of each second pixel point in the height map may be mapped to the height field to construct a topographic map with a three-dimensional visual effect.
[0088] In these embodiments, relative to the above second embodiment, step S320 may include the following steps S510 and S520:
[0089] Step S510: determining a second vertex of a height field of the virtual scene corresponding to the second pixel point based on a second attribute of the second pixel point in the height map.
[0090] In this embodiment, the height map is, for example, a grayscale map, the second attribute of the second pixel point is a color value, and the second pixel points on the height map may correspond one-to-one to the second vertices of the height field of the virtual scene.
[0091] Step S520, mapping the second attribute to the second vertex to obtain a topographic map.
[0092] In this embodiment, the color value of the second pixel point of the height map can be mapped to a height value of the second vertex corresponding to the height field. Then, when the height value of the second vertex of the height field is known, the fluctuation of the height field can be determined, and then it can be expressed as a topographic map.
[0093] <Fifth Embodiment>
[0094] In this embodiment, in order to realize the visualization of the constructed virtual scene, the virtual scene sets a third model of the second virtual object in the first position area, and after the user issues a display instruction of the virtual scene, the first model is displayed at the distributed position on the topographic map and at the first position area on the topographic map.
[0095] In these embodiments, relative to the first embodiment, after step S240, the method further includes the following step S610:
[0096] Step S610, in response to a user's instruction to display a virtual scene, display the first model located at a distribution position of the topographic map and the second virtual object located at a first position area of the topographic map.
[0097] In this embodiment, the second virtual object is a river, and the construction of the second virtual object in the virtual scene is based on a second object file, which includes a seventh object node, an eighth object node, a ninth object node and a tenth object node. The seventh object node grid1 is used to create a water surface, the eighth object node color1 is used to color the water surface, the ninth object node attribvop1 is used to increase the transparency of the water surface, and the tenth object node pack1 is used to pack the water surface.
[0098] In some examples, such as Figure 4 As shown, the first virtual object is a tree T1, the second virtual object is a river R2, the river R2 is set in the first position area of the topographic map G1, and trees T1 are set at various distribution positions. In addition, more trees T1 are distributed in the area near the river R2 to construct a more realistic virtual scene. Then, the virtual scene is adjusted by adjusting the parameters of the first virtual object and the second virtual object, thereby improving the efficiency of constructing the virtual scene.
[0099] <Device Example>
[0100] Figure 5 FIG. 2 shows a schematic diagram of the composition structure of a device for constructing a virtual scene according to an embodiment of the present disclosure. Figure 5 As shown, the virtual scene construction device 500 includes a first determination module 510 , a second determination module 520 , an obtaining module 530 and a setting module 540 .
[0101] The first determination module 510 is used to determine a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene based on a first input of a user;
[0102] The second determination module 520 is used to determine the mapping relationship between the first feature map and the first plane of the topographic map based on the first feature map input by the user; wherein the first pixel point of the first feature map is configured with a first feature value, and the first feature value is used to reflect the weight of the first virtual object distributed at the first pixel point;
[0103] The obtaining module 530 is used to obtain the second eigenvalue of the first vertex of the topographic map according to the mapping relationship and the first eigenvalue of the first pixel; wherein the second eigenvalue is used to reflect the weight of the first virtual object distributed at the first vertex;
[0104] The setting module 540 is used to set the distribution position of the first model in the topographic map according to the second eigenvalue of the first vertex.
[0105] In some embodiments, the first determination module 510 is also used to determine a first model of the first virtual object displayed in the virtual scene based on a first parameter in the user's first input; and to adjust a height value of a height field of the virtual scene based on a second parameter in the user's first input to obtain a terrain map of the virtual scene.
[0106] In some embodiments, the first determination module 510 is also used to determine the first component of the second model common to the first virtual object and the group file of the first component based on the first parameter value of the first parameter in the user's first input; set the first attribute value in the group file according to the first parameter value of the first parameter; set the first scaling value in the group file based on the scene size ratio set for the virtual scene; and control the second model to be updated to the first model displayed by the first virtual object in the virtual scene based on the first attribute value and the first scaling value.
[0107] In some embodiments, the first determination module 510 is further used to determine the second vertex of the height field of the virtual scene corresponding to the second pixel point based on the second attribute of the second pixel point in the height map; and map the second attribute to the second vertex to obtain a terrain map.
[0108] In some embodiments, the virtual scene construction device 500 also includes a display module, which is used to respond to the user's display instruction for the virtual scene and display the first model located at the distribution position of the topographic map and the second virtual object located at the first position area of the topographic map.
[0109] <Equipment Embodiment>
[0110] Figure 6 FIG. 1 shows a schematic diagram of the hardware structure of an electronic device according to some other embodiments. Figure 6As shown, the electronic device 600 includes a processor 610 and a memory 620, wherein the memory 620 is used to store a computer program, and the computer program is used to control the processor 610 to operate so as to control the electronic device 600 to execute the method for constructing a virtual scene according to any embodiment of the present disclosure.
[0111] The embodiments of the present disclosure further provide a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for constructing a virtual scene according to any embodiment of the present disclosure is implemented.
[0112] The disclosed embodiment also provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, a method for constructing a virtual scene according to any disclosed embodiment is implemented. The computer program product is, for example, a game client.
[0113] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0114] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0115] The embodiments of the present specification may be devices, methods and / or computer program products. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the embodiments of the present specification.
[0116] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0117] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0118] The computer program instructions for executing the operation of the embodiments of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or the first code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, executed as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of a computer-readable program instruction, and the electronic circuit may execute a computer-readable program instruction, thereby realizing various aspects of the embodiments of this specification.
[0119] Various aspects of the embodiments of the present specification are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (equipment) and computer program products according to the embodiments of the present specification. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0120] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0121] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0122] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of this specification. In this regard, each box in the flowchart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that it is equivalent to implement it by hardware, implement it by software, and implement it by combining software and hardware.
[0123] The embodiments of the present specification have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for constructing a virtual scene, the method comprising: Based on a first input from a user, determining a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene; Based on the first feature map input by the user, determining a mapping relationship between the first feature map and the first plane of the topographic map; wherein the first pixel point of the first feature map is configured with a first feature value, and the first feature value is used to reflect the weight of the first virtual object distributed by the first pixel point; According to the mapping relationship and the first eigenvalue of the first pixel point, a second eigenvalue of a first vertex of the topographic map is obtained; wherein the second eigenvalue is used to reflect the weight of the first virtual object distributed at the first vertex; The distribution position of the first model in the topographic map is set according to the second eigenvalue of the first vertex.
2. The method according to claim 1, wherein: The determining of a first model of the first virtual object displayed in the virtual scene and a topographic map of the virtual scene includes: Determine a first model of a first virtual object displayed in a virtual scene based on a first parameter in a first input by a user; Based on the second parameter in the first input of the user, the height value of the height field of the virtual scene is adjusted to obtain a topographic map of the virtual scene.
3. The method according to claim 2, wherein: The determining, based on a first parameter value of a first parameter in a first input of a user, a first model of a first virtual object displayed in a virtual scene comprises: Determine, based on a first parameter value of a first parameter in a first input by a user, a first component of a second model common to the first virtual object and a group file of the first component; According to a first parameter value of the first parameter, setting a first attribute value in the group file; Setting a first scaling value in the group file based on a scene size ratio set for the virtual scene; Based on the first attribute value and the first scaling value, the second model is controlled to be updated to a first model displayed by the first virtual object in the virtual scene.
4. The method according to claim 2, wherein: The second parameter includes a second attribute of a second pixel point in the height map; and adjusting the height value of the height field of the virtual scene based on the second parameter in the first input of the user to obtain a topographic map of the virtual scene includes: Determine, based on a second attribute of a second pixel point in the height map, a second vertex of the height field of the virtual scene corresponding to the second pixel point; The second attribute is mapped to the second vertex to obtain a topographic map.
5. The method according to claim 1, wherein: The first feature map is a grayscale map, and the first feature value of the first pixel is a grayscale value; wherein the grayscale value is used to measure the weight of the first pixel distributing the first virtual object.
6. The method according to claim 1, wherein: The first plane of the topographic map includes a first plane area of a first surface type and a second plane area of a second surface type, the second eigenvalue of the first vertex located in the first plane area is a fixed value, and the second eigenvalue of the first vertex located in the second plane area is related to the first distance value; wherein the first distance value is the distance value between the first vertex located in the first plane area and the nearest first vertex located in the second plane area.
7. The method according to claim 1, wherein: The virtual scene sets a third model of a second virtual object in the first position area; the method further comprises: In response to the user's instruction to display the virtual scene, it is displayed that the first model is located at the distribution position of the topographic map and the second virtual object is located at the first position area of the topographic map.
8. A device for constructing a virtual scene, wherein: The device comprises: A first determining module, configured to determine a first model of a first virtual object displayed in a virtual scene and a topographic map of the virtual scene based on a first input from a user; A second determination module is configured to determine a mapping relationship between the first feature map and the first plane of the topographic map based on the first feature map input by the user; wherein the first pixel point of the first feature map is configured with a first feature value, and the first feature value is used to reflect the weight of the first virtual object distributed by the first pixel point; an obtaining module, configured to obtain a second eigenvalue of a first vertex of the topographic map according to the mapping relationship and the first eigenvalue of the first pixel; wherein the second eigenvalue is used to reflect a weight of the first virtual object distributed at the first vertex; A setting module is used to set the distribution position of the first model in the topographic map according to the second eigenvalue of the first vertex.
9. An electronic device, wherein: The method comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the method steps according to any one of claims 1 to 7 under the control of the computer program.
10. A computer-readable storage medium, the computer-readable storage medium comprising a stored computer program, wherein: When the computer program is executed, the method steps of any one of claims 1 to 7 are performed.