Method and apparatus for realizing spider silk effect, electronic device and storage medium

CN116459525BActive Publication Date: 2026-09-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310528859.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2026-09-11
Estimated Expiration
2043-05-09

AI Technical Summary

Technical Problem

[0003]然而,绳索组件仅能供使用者通过设置材质来控制绳子的外观表现,无法设置自定义的模型,其次,绳索组件在生成绳索时,两个相邻节点之间通是过直线连接,导致生成的整条绳索没有平滑过渡,最后,绳索的运动轨迹完全依赖重力模拟和约束模拟进行计算,模拟出来的节点之间的相对运动太过灵活

Benefits of technology

[0036] This application embodiment can obtain a spider silk model to be rendered, the spider silk model including multiple nodes; determine the current rendering stage, the rendering stage corresponding to the life stage of the spider silk model; determine the motion trajectory of multiple nodes by physical simulation and/or non-physical simulation methods according to the rendering stage; render the spider silk model according to the motion trajectory of multiple nodes to obtain the spider silk effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116459525B_ABST
    Figure CN116459525B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a spider silk effect implementation method and device, electronic equipment and a storage medium; embodiments of the present application can obtain a spider silk model to be rendered, the spider silk model comprising a plurality of nodes; a current rendering stage is determined, the rendering stage corresponding to a life stage of the spider silk model; according to the rendering stage, a method for calculating the motion trajectory of the plurality of nodes by physical simulation and / or non-physical simulation is determined; the spider silk model is rendered according to the motion trajectory of the plurality of nodes, and a spider silk effect is obtained. In embodiments of the present application, the motion trajectory of the plurality of nodes of the spider silk model can be fitted to the life stage of the spider silk model, so that the spider silk effect can be close to nature, thus facilitating the simulation of the appearance of spider silk, and also facilitating the control of the motion of the spider silk in a game scene, so that the spider silk has a light effect when moving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and specifically to a method, apparatus, electronic device, and storage medium for implementing a spider silk effect. Background Technology

[0002] Unreal Engine includes a CableComponent for simulating ropes. The CableComponent can provide gravity and constraint simulations to simulate the motion trajectory of each node of the rope.

[0003] However, the rope component only allows users to control the appearance of the rope by setting the material, and cannot set a custom model. Secondly, when generating the rope, the rope component connects two adjacent nodes with straight lines, resulting in a lack of smooth transition in the generated rope. Finally, the rope's motion trajectory relies entirely on gravity simulation and constraint simulation for calculation, and the simulated relative motion between nodes is too flexible.

[0004] Therefore, it is not convenient to simulate the appearance of spider silk through rope components, and it is also inconvenient to control the movement of spider silk in the game scene to make the spider silk have a light effect when moving. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for achieving a spider silk effect, which facilitates the simulation of the appearance of spider silk and also facilitates the control of spider silk movement in game scenes, giving the spider silk a light and graceful effect when moving.

[0006] This application provides a method for achieving a spider silk effect, the method including:

[0007] Obtain the spider silk model to be rendered. The spider silk model includes multiple nodes.

[0008] Determine the current rendering stage, which corresponds to the lifecycle stage of the spider silk model;

[0009] Based on the rendering stage, determine the methods for calculating the motion trajectories of multiple nodes using physical simulation and / or non-physical simulation methods;

[0010] The spider silk model is rendered based on the motion trajectories of multiple nodes to obtain the spider silk effect.

[0011] In some embodiments, obtaining the spider silk model to be rendered includes:

[0012] Generate multiple nodes;

[0013] Generate curves between nodes to connect multiple nodes sequentially;

[0014] Based on the curves between nodes, a static mesh is generated, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of static meshes and nodes.

[0015] In some embodiments, generating a static mesh based on the curves between nodes includes:

[0016] Generate an initial static mesh;

[0017] The initial static mesh is distorted based on the curvature of the curves between nodes to obtain the static mesh.

[0018] In some embodiments, generating an initial static mesh volume includes:

[0019] Obtain model parameters;

[0020] Generate an initial static mesh based on the model parameters.

[0021] In some embodiments, multiple nodes are generated, including:

[0022] Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated;

[0023] Generate the target number of nodes.

[0024] In some embodiments, determining the motion trajectories of multiple nodes by means of physical simulation and / or non-physical simulation methods, depending on the rendering stage, includes:

[0025] When the rendering stage corresponds to the first life stage of the spider silk model, the motion trajectory of multiple nodes is calculated using a non-physical simulation method.

[0026] When the rendering stage corresponds to the second life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using both non-physical simulation and physical simulation methods.

[0027] When the rendering stage corresponds to the third life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using physical simulation methods.

[0028] In some embodiments, the life phases include a launch phase, a pull phase, and a defilament phase.

[0029] This application embodiment also provides a device for achieving a spider silk effect, the device comprising:

[0030] The acquisition unit is used to acquire the spider silk model to be rendered. The spider silk model includes multiple nodes.

[0031] The stage determination unit is used to determine the current rendering stage, which corresponds to the life stage of the spider silk model.

[0032] The trajectory calculation unit is used to determine the motion trajectory of multiple nodes by physical simulation and / or non-physical simulation methods based on the rendering stage.

[0033] The rendering unit is used to render the spider silk model based on the motion trajectory of multiple nodes to obtain the spider silk effect.

[0034] This application also provides an electronic device, including a memory storing multiple instructions; a processor loads instructions from the memory to execute the steps in any of the spider silk effect implementation methods provided in this application.

[0035] This application also provides a computer-readable storage medium storing multiple instructions adapted for loading by a processor to execute steps in any of the spider silk effect implementation methods provided in this application.

[0036] This application embodiment can obtain a spider silk model to be rendered, the spider silk model including multiple nodes; determine the current rendering stage, the rendering stage corresponding to the life stage of the spider silk model; determine the motion trajectory of multiple nodes by physical simulation and / or non-physical simulation methods according to the rendering stage; render the spider silk model according to the motion trajectory of multiple nodes to obtain the spider silk effect.

[0037] In this application, the life stages of the spider silk model are in a dynamic process. Based on the current life stage of the spider silk model, the motion trajectories of multiple nodes of the spider silk model can be calculated using physical simulation methods, a combination of physical and non-physical simulation methods, or non-physical simulation methods. This ensures that the motion trajectories of multiple nodes of the spider silk model can fit the life stage of the spider silk model. In this way, rendering the spider silk model using the motion trajectories of multiple nodes makes it easier to simulate the appearance of the spider silk model, making the spider silk effect closer to nature. At the same time, it also makes it easier to control the movement of the spider silk in the game scene, giving the spider silk a light and graceful effect when moving. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1a This is a schematic diagram of a scenario illustrating the method for implementing the spider silk effect provided in this application embodiment;

[0040] Figure 1bThis is a flowchart illustrating the method for implementing the spider silk effect provided in this application embodiment;

[0041] Figure 1c This is a schematic diagram of a spider silk model emission scenario provided in an embodiment of this application;

[0042] Figure 1d This is a schematic diagram of a scenario where the spider silk model provided in this application is in a taut state;

[0043] Figure 1e This is a schematic diagram of a scenario where the spider silk model detaches from the virtual object, as provided in an embodiment of this application.

[0044] Figure 2 This is a flowchart illustrating the implementation of the spider silk effect method provided in this application embodiment in Unreal Engine;

[0045] Figure 3 This is a schematic diagram of the structure of the device for achieving the spider silk effect provided in the embodiments of this application;

[0046] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] This application provides a method, apparatus, electronic device, and storage medium for achieving a spider silk effect.

[0049] Specifically, the device for achieving the spider silk effect can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet, smart Bluetooth device, laptop, or personal computer (PC); the server can be a single server or a server cluster consisting of multiple servers.

[0050] In some embodiments, the device for implementing the spider silk effect can also be integrated into multiple electronic devices. For example, the device for implementing the spider silk effect can be integrated into multiple servers, and the spider silk effect implementation method of this application can be implemented by multiple servers.

[0051] Currently, the rope component only allows users to control the appearance of the rope by setting the material, and cannot set custom models. Secondly, when generating a rope, the rope component connects two adjacent nodes with straight lines, resulting in a lack of smooth transition in the generated rope. Finally, the rope's motion trajectory relies entirely on gravity and constraint simulations for calculation, and the simulated relative motion between nodes is too flexible. Therefore, if it is necessary to launch spider silk in a game scene, it is not convenient to simulate the appearance of spider silk through the rope component, and it is also inconvenient to control the movement of spider silk in the game scene to make the spider silk move with a light effect.

[0052] To facilitate the simulation of spider silk's appearance and the control of its movement within a game scene, this application proposes a method for implementing a spider silk effect, referencing... Figure 1a Server B can obtain a spider silk model to be rendered from electronic device A. The spider silk model includes multiple nodes. It determines the current rendering stage, which corresponds to the life stage of the spider silk model. Based on the rendering stage, it determines the motion trajectory of the multiple nodes to be calculated by physical simulation and / or non-physical simulation methods. Server B sends the motion trajectory to electronic device A, and electronic device A renders the spider silk model based on the motion trajectory of the multiple nodes to obtain the spider silk effect.

[0053] The lifecycle of the spider silk model is in a dynamic process. By analyzing the current lifecycle stage of the spider silk model, the motion trajectories of multiple nodes of the spider silk model can be calculated using physical simulation, a combination of physical and non-physical simulation, or non-physical simulation. This ensures that the motion trajectories of multiple nodes of the spider silk model are consistent with its lifecycle stage. In this way, rendering the spider silk model using the motion trajectories of multiple nodes makes it easier to simulate the appearance of the spider silk model, making the spider silk effect closer to nature. At the same time, it also makes it easier to control the movement of the spider silk in the game scene, giving the spider silk a light and graceful effect when moving.

[0054] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.

[0055] In this embodiment, a method for achieving a spider silk effect is provided, such as... Figure 1b As shown, the specific process for implementing this spider silk effect can be described as follows:

[0056] 110. Obtain the spider silk model to be rendered. The spider silk model includes multiple nodes.

[0057] The spider silk model refers to the virtual spider silk to be rendered in the game scene. For example, the virtual spider silk model can be a spider silk model that has already been launched, a virtual spider silk model that is being pulled, a spider silk model that has escaped control, and so on.

[0058] Game scenes can be composed of virtual objects such as virtual characters, buildings, terrain, plants, and animals. For example, virtual objects in a game scene can include virtual characters, virtual buildings, and virtual items. Virtual characters can include player-controlled virtual characters and non-player characters (virtual NPCs), virtual buildings can include virtual defense towers, virtual hot springs, virtual respawn points, etc., and virtual items can include virtual pets, virtual mounts, dropped virtual money bags, etc.

[0059] Nodes are movable points distributed on the spider silk model. The movement of multiple nodes can drive the movement of the spider silk model.

[0060] For example, there is a virtual object in the game scene that has the function of launching spider silk models. After the virtual object triggers the function of launching spider silk models, it can obtain the spider silk model to be rendered. If the spider silk model hits a virtual object in the game scene, it can obtain the spider silk model to be rendered again. Or, if the virtual spider silk does not hit a virtual object after a preset period of time, it can obtain the spider silk model to be rendered again. Or, if the virtual spider silk hits an object and then leaves the control of the object and / or the virtual object, it can obtain the virtual spider silk model to be rendered again, and so on.

[0061] Virtual objects refer to virtual objects that the spider web model hits in the game scene. For example, virtual objects can be virtual characters, virtual buildings, virtual props, etc.

[0062] In some embodiments, in order to display virtual spider silk in a game scene on a terminal, obtaining a spider silk model to be rendered includes:

[0063] Generate multiple nodes;

[0064] Generate curves between nodes to connect multiple nodes sequentially;

[0065] Based on the curves between nodes, a static mesh is generated, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of static meshes and nodes.

[0066] The curve is used to connect two adjacent nodes and has a natural curvature. For example, the curve can be pre-set or generated by algorithms such as Bézier curve algorithm or B-spline curve algorithm.

[0067] A static mesh is a 3D mesh model that does not deform or change during runtime. Its number of vertices and faces remains fixed after creation. It is used to replace the curves between adjacent nodes to present a spider web shape at the end.

[0068] For example, a static mesh can be a pre-set model created by an artist, with parameters customized by the artist, thus achieving a better spiderweb appearance.

[0069] For example, based on the curves between nodes, static meshes can be generated through rasterization, model topology, physics engines, procedural generation, and other methods. Rasterization extracts depth information from two-dimensional images to generate three-dimensional models, which can be used to build models in game scenes. Model topology can convert two-dimensional images into three-dimensional models. Algorithms such as contour lines and intersection point analysis can automatically adjust wireframes into 3D models. Physics engines can automatically generate models in game scenes based on the curves between nodes. Procedural generation uses algorithms to automatically generate meshes, and so on.

[0070] For example, after generating a static mesh, curves can be deleted or hidden, thereby allowing the static mesh to replace the corresponding curves and present a spider web model composed of static meshes and nodes on the terminal.

[0071] In some embodiments, in order to make the terminal present a naturally curved and smooth spider silk model, a static mesh is generated based on the curves between the nodes, including:

[0072] Generate an initial static mesh;

[0073] The initial static mesh is distorted based on the curvature of the curves between nodes to obtain the static mesh.

[0074] The initial static mesh is a 3D mesh model set between two adjacent nodes. For example, the initial static mesh can be a pre-set art-created model, or it can be a static mesh obtained by generating a curve from the rope component in the game engine and assigning it a material. The initial static mesh can extend along the curve or not, and so on.

[0075] For example, the initial static mesh can be distorted according to the curvature of the curve between nodes so that the parts of the static mesh that do not extend along the curve can extend along the curve, so that the static mesh can bend naturally.

[0076] When warping the initial static mesh, methods such as interpolation algorithms, deformation tools, and path animation can be used to warp the initial static mesh.

[0077] When using the interpolation algorithm, a series of points are created that can represent some positions on the curve. These points are then used as control points to control the initial static mesh volume so that it extends along the curve.

[0078] When using deformation tools, import the initial static mesh and curve that need to be extended into the 3D modeling software, and then use deformation tools (such as the Deform tool) to adjust the initial static mesh that needs to be extended so that it fits the curve.

[0079] When using path animation, the effect of extending along the curve can be achieved by using the curve as the path, creating an initial static mesh in 3D modeling software, and adding it to the curve for motion.

[0080] In some embodiments, considering that curves cannot replace the spider silk model, in order for the terminal to display the spider silk model, an initial static mesh is generated, including:

[0081] Obtain model parameters;

[0082] Generate an initial static mesh based on the model parameters.

[0083] The model parameters are the model parameters that can be used to create spider web models in the game scene.

[0084] For example, model parameters can be parameters corresponding to a pre-set initial static mesh, or parameters corresponding to a newly created initial static mesh, and so on.

[0085] In some embodiments, considering that the spider silk model has multiple stages in the game scene, such as launching, pulling, and unwinding, and that each stage of the spider silk model needs to reflect different spider silk effects in the game scene, in order to make the created spider silk model fit the current rendering stage, multiple nodes are generated, including:

[0086] Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated;

[0087] Generate the target number of nodes.

[0088] The lifespan of a spider silk model can be determined by its control method. For example, the lifespan of a spider silk model can be the stage when it is launched, the stage when it is pulled, or the stage when it is released from control.

[0089] The target number is the number of nodes distributed on the spider silk model, which can be used to control the movement of the spider silk model in the game scene.

[0090] For example, if the life stage of the spider silk model is the life stage corresponding to when the spider silk model is launched, then the number of target nodes to be generated can increase at preset time intervals until the number of nodes hitting the virtual object or distributed on the spider silk model reaches the preset number, and then the increase stops. If the life stage of the spider silk model is the stage of pulling the spider silk model or the stage when the spider silk model is out of control, then the number of target nodes to be generated can be zero.

[0091] 120. Determine the current rendering stage, which corresponds to the lifecycle stage of the spider silk model.

[0092] The life stages of the spider silk model can be determined by the control method of the spider silk model.

[0093] For example, the specific control method of the spider silk model can be the way virtual objects in the game scene launch, pull, and the way the spider silk model is released from control after being launched or pulled. That is, the life stage of the spider silk model can be the life stage corresponding to when the spider silk model is launched, the life stage corresponding to when the spider silk model is pulled, or the stage corresponding to when the spider silk model is released from control.

[0094] The current rendering stage is the stage corresponding to the lifecycle stage of the spider silk model. For example, the current rendering stage could be the stage corresponding to the spider silk model during firing, the stage corresponding to the spider silk model during dragging, or the stage corresponding to the spider silk model being out of control after firing or dragging.

[0095] In some embodiments, the life phases include a launch phase, a pull phase, and a defilament phase.

[0096] The launching phase refers to the stage where virtual objects in the game scene launch spider web models. For example... Figure 1c As shown, virtual object 01 emits a spider silk model 03, and nodes 02 distributed on the spider silk model 03 move the spider silk model 03. Figure 1c The spider silk model 03 is used here only as an example.

[0097] The pulling phase refers to the phase in the game scene where a spider web model is launched from a virtual object and then hits the virtual object. For example... Figure 1d As shown, virtual object 01 emits spider silk model 03, which hits virtual object 04. The virtual object pulls the spider silk model 03, making it taut.

[0098] The unwinding stage refers to the phase in a game scene where the spider silk model, after being launched or pulled, detaches from the control of the virtual object. For example... Figure 1eAs shown, the spider silk model 03 breaks free from the control of the virtual object 01 and hits the virtual object 04, causing the spider silk model 03 to fall.

[0099] 130. Based on the rendering stage, determine the methods for calculating the motion trajectories of multiple nodes using physical simulation and / or non-physical simulation.

[0100] Physics simulation allows the spider silk model to be subjected to gravity and constraint simulations within the game scene. For example, under the influence of physics simulation, the length of the spider silk model cannot be changed; it can only be affected by the gravity parameters set in the game scene and the constraint parameters during the spider silk model's movement.

[0101] Non-physics simulation allows the spider silk model to be unaffected by gravity and constraint simulations in the game scene. For example, without physical simulation, the spider silk model is unaffected by the gravity parameters set in the game scene and the constraint parameters when the spider silk model moves, allowing the distance between two adjacent nodes in the spider silk model to be increased in the non-physics simulation.

[0102] Among them, the non-physical model can be the calculation formula for the movement of the spider silk model set by the game designer. Through this calculation formula, the spider silk model can be made to have a light effect when moving.

[0103] The motion trajectory refers to the movement trajectory of multiple nodes distributed on the spider web model in the game scene. For example, during the rendering stage, the motion trajectory of multiple nodes can be calculated using physical simulation, physical simulation and non-physical simulation, or non-physical simulation.

[0104] In some embodiments, considering that the spider silk model has multiple lifecycles, in order to make the motion trajectory of the spider silk model natural, the motion trajectory of multiple nodes is calculated by physical simulation and / or non-physical simulation methods according to the rendering stage, including:

[0105] When the rendering stage corresponds to the first life stage of the spider silk model, the motion trajectory of multiple nodes is calculated using a non-physical simulation method.

[0106] When the rendering stage corresponds to the second life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using both non-physical simulation and physical simulation methods.

[0107] When the rendering stage corresponds to the third life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using physical simulation methods.

[0108] The first life stage of the spider silk model can be the stage corresponding to when a virtual object in the game scene launches the spider silk model.

[0109] The second life stage of the spider silk model can be the stage when the virtual object pulls the spider silk model after the spider silk model hits the virtual object.

[0110] The third life stage of the spider silk model can be the stage when the spider silk model is no longer under the control of the virtual object, the stage when the spider silk model fails to hit the virtual object after a preset time period, or the stage when the spider silk model is not controlled by the virtual object.

[0111] For example, in the first life stage of the spider silk model, which is the launch stage, in order to make the spider silk model have an elongation effect, a non-physical simulation method is used to calculate the motion trajectory of multiple nodes distributed in the spider silk model.

[0112] In the second life stage of the spider silk model, which is the stretching stage, the spider silk model can be in a taut state and the motion trajectory of multiple nodes distributed in the spider silk model can be calculated using a non-physical simulation method. When the spider silk model is in a bent state, the motion trajectory of multiple nodes distributed in the spider silk model can be calculated using a physical simulation method.

[0113] During the unwinding phase of the spider silk model, in order to allow the spider silk model to fall naturally into the game scene, the spider silk model can be simulated using physics to calculate the movement trajectory of multiple nodes distributed on the spider silk model.

[0114] In some embodiments, after a virtual object fires a spider silk model that hits a virtual object, the spider silk model is in a taut state for a first preset time period and in a bent state for a second preset time period, wherein the first preset time period and the second preset time period are consecutive time periods.

[0115] For example, if the time when the virtual object's spider web model hits the virtual object is point a, then the first preset time period can be from point a to point b, and the second preset time period can be from point b to point c. Here, the duration from point a to point b and the duration from point b to point c are not limited.

[0116] 140. Render the spider silk model based on the motion trajectories of multiple nodes to obtain the spider silk effect.

[0117] The spider silk effect refers to the appearance of the rendered spider silk model on the terminal. For example, the spider silk effect could be the lightness of the spider silk model, or the effect of the spider silk model being affected by gravity in the game scene, and so on.

[0118] As can be seen from the above, the embodiments of this application can obtain a spider silk model to be rendered, which includes multiple nodes; determine the current rendering stage, which corresponds to the life stage of the spider silk model; determine the motion trajectory of multiple nodes by physical simulation and / or non-physical simulation methods according to the rendering stage; and render the spider silk model according to the motion trajectory of multiple nodes to obtain the spider silk effect.

[0119] Therefore, in this solution, the life stages of the spider silk model are in a dynamic process. Based on the current life stage of the spider silk model, the motion trajectories of multiple nodes of the spider silk model can be calculated using physical simulation methods, a combination of physical and non-physical simulation methods, or non-physical simulation methods. This ensures that the motion trajectories of multiple nodes of the spider silk model can be aligned with the life stage of the spider silk model. In this way, rendering the spider silk model using the motion trajectories of multiple nodes facilitates the simulation of the appearance of the spider silk model, making the spider silk effect closer to nature. At the same time, it also facilitates the control of the movement of the spider silk in the game scene, giving the spider silk a light and graceful effect when moving.

[0120] The method described in the above embodiments will be further described in detail below.

[0121] In this embodiment, the method of implementing the spider web effect in Unreal Engine will be used as an example to describe the method of this application embodiment in detail.

[0122] like Figure 2 As shown, the specific process for implementing a spider silk effect is as follows:

[0123] 210. Create a new class that inherits from the Unreal Engine (i.e., the game engine) native rope component (UCableComponent) to have the native rope functionality of the rope component.

[0124] 220. Disable the native rendering logic of the rope component.

[0125] 230. Connect the multiple nodes generated by the rope component into a smooth curve.

[0126] 240. Based on the curve, the mesh model is spliced ​​to obtain a static mesh.

[0127] In some embodiments, the mesh model can be a StaticMesh model in Unreal Engine.

[0128] 250. Overload the physics simulation interface of UCableComponent and add a switch to disable the physics simulation function in the early stages of the spider silk model's launch and pulling phases, and use non-physics simulation (mathematical calculation) to control the spider silk's trajectory to obtain the spider silk effect.

[0129] In some embodiments, the spider silk model is in the firing phase: physical simulation is turned off and non-physical simulation is used instead to calculate the motion trajectories of multiple nodes distributed on the spider silk model.

[0130] In some embodiments, the spider silk model is in a stretching phase: when the spider silk model is relatively long, non-physical simulation control is used to keep the spider silk model in a taut state; when the spider silk is relatively short, physical simulation is used to make the spider silk bend naturally.

[0131] In some embodiments, when the spider silk model is in the unwinding stage, physical simulation is used to simulate the natural falling of the spider silk model.

[0132] As shown above, this solution can simulate the movement trajectory of the spider silk model by combining non-physical simulation and physical simulation. At the same time, it can also use a custom model created by the artist to display the appearance of the spider silk model.

[0133] To better implement the above methods, this application also provides a device for achieving a spider silk effect. This device can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, or personal computer; the server can be a single server or a server cluster composed of multiple servers.

[0134] For example, in this embodiment, the method of this application embodiment will be described in detail by taking the device for realizing the spider silk effect as specifically integrated into an electronic device.

[0135] For example, such as Figure 3 As shown, the device for implementing the spider silk effect may include an acquisition unit 310, a stage determination unit 320, a trajectory calculation unit 330, and a rendering unit 340, as follows:

[0136] (I) Acquisition Unit 310.

[0137] The acquisition unit 310 is used to acquire the spider silk model to be rendered, which includes multiple nodes.

[0138] In some embodiments, obtaining the spider silk model to be rendered includes:

[0139] Generate multiple nodes;

[0140] Generate curves between nodes to connect multiple nodes sequentially;

[0141] Based on the curves between nodes, a static mesh is generated, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of static meshes and nodes.

[0142] In some embodiments, generating a static mesh based on the curves between nodes includes:

[0143] Generate an initial static mesh;

[0144] The initial static mesh is distorted based on the curvature of the curves between nodes to obtain the static mesh.

[0145] In some embodiments, generating an initial static mesh volume includes:

[0146] Obtain model parameters;

[0147] Generate an initial static mesh based on the model parameters.

[0148] In some embodiments, multiple nodes are generated, including:

[0149] Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated;

[0150] Generate the target number of nodes.

[0151] (II) Stage determination of unit 320.

[0152] The stage determination unit 320 is used to determine the current rendering stage, which corresponds to the life stage of the spider silk model.

[0153] In some embodiments, the life phases include a launch phase, a pull phase, and a defilament phase.

[0154] (III) Trajectory Calculation Unit 330.

[0155] The trajectory calculation unit 330 is used to determine the motion trajectory of multiple nodes by means of physical simulation and / or non-physical simulation, based on the rendering stage.

[0156] In some embodiments, determining the motion trajectories of multiple nodes by means of physical simulation and / or non-physical simulation methods, depending on the rendering stage, includes:

[0157] When the rendering stage corresponds to the first life stage of the spider silk model, the motion trajectory of multiple nodes is calculated using a non-physical simulation method.

[0158] When the rendering stage corresponds to the second life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using both non-physical simulation and physical simulation methods.

[0159] When the rendering stage corresponds to the third life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using physical simulation methods.

[0160] (iv) Rendering Unit 340.

[0161] Rendering unit 340 is used to render the spider silk model based on the motion trajectory of multiple nodes to obtain the spider silk effect.

[0162] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.

[0163] As can be seen from the above, the device for implementing the spider silk effect in this embodiment obtains the spider silk model to be rendered by the acquisition unit, which includes multiple nodes; the stage determination unit determines the current rendering stage, which corresponds to the life stage of the spider silk model; the trajectory calculation unit determines the motion trajectory of the multiple nodes by physical simulation and / or non-physical simulation methods according to the rendering stage; and the rendering unit renders the spider silk model according to the motion trajectory of the multiple nodes to obtain the spider silk effect.

[0164] Therefore, the embodiments of this application can easily simulate the appearance of spider silk, and at the same time, it is also easy to control the movement of spider silk in the game scene, so that the spider silk has a light effect when moving.

[0165] Accordingly, this application also provides an electronic device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer, personal digital assistant (PDA) and other terminal devices.

[0166] like Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 400 includes a processor 410 with one or more processing cores, a memory 420 with one or more computer-readable storage media, and a computer program stored in the memory 420 and executable on the processor. The processor 410 is electrically connected to the memory 420. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0167] The processor 410 is the control center of the electronic device 400. It connects various parts of the electronic device 400 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 420, and calling data stored in the memory 420, it performs various functions of the electronic device 400 and processes data, thereby monitoring the electronic device 400 as a whole.

[0168] In this embodiment, the processor 410 in the electronic device 400 loads the instructions corresponding to the processes of one or more applications into the memory 420 according to the following steps, and the processor 410 runs the applications stored in the memory 420 to realize various functions:

[0169] A method for achieving a spider silk effect, the method includes:

[0170] Obtain the spider silk model to be rendered. The spider silk model includes multiple nodes.

[0171] Determine the current rendering stage, which corresponds to the lifecycle stage of the spider silk model;

[0172] Based on the rendering stage, determine the methods for calculating the motion trajectories of multiple nodes using physical simulation and / or non-physical simulation methods;

[0173] The spider silk model is rendered based on the motion trajectories of multiple nodes to obtain the spider silk effect.

[0174] In some embodiments, obtaining the spider silk model to be rendered includes:

[0175] Generate multiple nodes;

[0176] Generate curves between nodes to connect multiple nodes sequentially;

[0177] Based on the curves between nodes, a static mesh is generated, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of static meshes and nodes.

[0178] In some embodiments, generating a static mesh based on the curves between nodes includes:

[0179] Generate an initial static mesh;

[0180] The initial static mesh is distorted based on the curvature of the curves between nodes to obtain the static mesh.

[0181] In some embodiments, generating an initial static mesh volume includes:

[0182] Obtain model parameters;

[0183] Generate an initial static mesh based on the model parameters.

[0184] In some embodiments, multiple nodes are generated, including:

[0185] Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated;

[0186] Generate the target number of nodes.

[0187] In some embodiments, determining the motion trajectories of multiple nodes by means of physical simulation and / or non-physical simulation methods, depending on the rendering stage, includes:

[0188] When the rendering stage corresponds to the first life stage of the spider silk model, the motion trajectory of multiple nodes is calculated using a non-physical simulation method.

[0189] When the rendering stage corresponds to the second life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using both non-physical simulation and physical simulation methods.

[0190] When the rendering stage corresponds to the third life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using physical simulation methods.

[0191] In some embodiments, the life phases include a launch phase, a pull phase, and a defilament phase.

[0192] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0193] Optional, such as Figure 4 As shown, the electronic device 400 also includes: a touch display screen 430, a radio frequency circuit 440, an audio circuit 450, an input unit 460, and a power supply 470. The processor 410 is electrically connected to the touch display screen 430, the radio frequency circuit 440, the audio circuit 450, the input unit 460, and the power supply 470. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0194] The touch display screen 430 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 430 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 410. It can also receive and execute commands from the processor 410. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 410 to determine the type of touch event. Subsequently, the processor 410 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 430 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 430 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 430 can also be used as part of the input unit 460 to achieve input functions.

[0195] In this embodiment, a game application is executed by processor 410 to generate a graphical user interface (GUI) on touch display screen 430. The virtual scene on the GUI includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 430 is used to present the GUI and receive operation commands generated by the user interacting with the GUI.

[0196] The radio frequency circuit 440 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.

[0197] Audio circuitry 450 can be used to provide an audio interface between a user and an electronic device via a speaker and a microphone. Audio circuitry 450 can convert received audio data into electrical signals and transmit them to the speaker, where the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 450, converted back into audio data, and then processed by processor 410 before being transmitted via radio frequency circuitry 440 to, for example, another electronic device, or output to memory 420 for further processing. Audio circuitry 450 may also include an earphone jack to provide communication between peripheral headphones and electronic devices.

[0198] The input unit 460 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0199] Power supply 470 is used to power various components of electronic device 400. Optionally, power supply 470 can be logically connected to processor 410 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 470 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0200] although Figure 4 As not shown in the diagram, the electronic device 400 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0201] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0202] As can be seen from the above, the electronic device provided in this embodiment can easily simulate the appearance of spider silk, and at the same time, it is also easy to control the movement of spider silk in the game scene, so that the spider silk has a light effect when moving.

[0203] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0204] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple computer programs that can be loaded by a processor to execute the steps in any of the spider silk effect implementation methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0205] A method for achieving a spider silk effect, the method includes:

[0206] Obtain the spider silk model to be rendered. The spider silk model includes multiple nodes.

[0207] Determine the current rendering stage, which corresponds to the lifecycle stage of the spider silk model;

[0208] Based on the rendering stage, determine the methods for calculating the motion trajectories of multiple nodes using physical simulation and / or non-physical simulation methods;

[0209] The spider silk model is rendered based on the motion trajectories of multiple nodes to obtain the spider silk effect.

[0210] In some embodiments, obtaining the spider silk model to be rendered includes:

[0211] Generate multiple nodes;

[0212] Generate curves between nodes to connect multiple nodes sequentially;

[0213] Based on the curves between nodes, a static mesh is generated, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of static meshes and nodes.

[0214] In some embodiments, generating a static mesh based on the curves between nodes includes:

[0215] Generate an initial static mesh;

[0216] The initial static mesh is distorted based on the curvature of the curves between nodes to obtain the static mesh.

[0217] In some embodiments, generating an initial static mesh volume includes:

[0218] Obtain model parameters;

[0219] An initial static mesh is generated based on the model parameters.

[0220] In some embodiments, multiple nodes are generated, including:

[0221] Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated;

[0222] Generate the target number of nodes.

[0223] In some embodiments, determining the motion trajectories of multiple nodes by means of physical simulation and / or non-physical simulation methods, depending on the rendering stage, includes:

[0224] When the rendering stage corresponds to the first life stage of the spider silk model, the motion trajectory of multiple nodes is calculated using a non-physical simulation method.

[0225] When the rendering stage corresponds to the second life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using both non-physical simulation and physical simulation methods.

[0226] When the rendering stage corresponds to the third life stage of the spider silk model, the motion trajectories of multiple nodes are calculated using physical simulation methods.

[0227] In some embodiments, the life phases include a launch phase, a pull phase, and a defilament phase.

[0228] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0229] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0230] Since the computer program stored in the storage medium can execute the steps in any of the spider silk effect implementation methods provided in the embodiments of this application, the beneficial effects that any of the spider silk effect implementation methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0231] The foregoing has provided a detailed description of a method, apparatus, storage medium, and computer device for achieving a spider silk effect according to embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for achieving a spider silk effect, characterized in that, The method includes: Obtain the spider silk model to be rendered, the spider silk model including multiple nodes; The current rendering stage is determined, and the rendering stage corresponds to the life stage of the spider silk model. The life stage includes the launch stage, the pull stage, and the unwinding stage. The launch stage is the stage in which a virtual object in the game scene launches the spider silk model; the pull stage is the stage corresponding to when the spider silk model hits a virtual object; and the unwinding stage is the stage in which the spider silk model is released from the control of the virtual object. Based on the rendering stage, the motion trajectories of the multiple nodes are determined to be calculated using physical simulation and / or non-physical simulation methods, wherein: When the rendering stage corresponds to the emission stage of the spider silk model, the motion trajectory of the multiple nodes is determined to be calculated by a non-physical simulation method. When the rendering stage corresponds to the pulling stage of the spider silk model, the motion trajectory of the multiple nodes is calculated by a combination of non-physical simulation and physical simulation. When the rendering stage corresponds to the unwinding stage of the spider silk model, the motion trajectory of the multiple nodes is determined by physical simulation. The spider silk model is rendered based on the motion trajectories of the multiple nodes to obtain the spider silk effect.

2. The method according to claim 1, characterized in that, The process of obtaining the spider silk model to be rendered includes: Generate multiple nodes; Curves are generated between the nodes to connect the plurality of nodes sequentially; A static mesh is generated based on the curves between the nodes, and the corresponding curves are replaced by the static mesh to obtain a spider silk model composed of the static mesh and the nodes.

3. The method according to claim 2, characterized in that, The step of generating a static mesh based on the curves between the nodes includes: Generate an initial static mesh; The initial static mesh is twisted according to the curvature of the curve between the nodes to obtain a static mesh.

4. The method according to claim 3, characterized in that, The generation of the initial static mesh includes: Obtain model parameters; The initial static mesh is generated based on the model parameters.

5. The method according to claim 2, characterized in that, The generation of multiple nodes includes: Based on the lifecycle stages of the spider silk model, determine the target number of nodes to be generated; Generate the target number of nodes.

6. A device for achieving a spider silk effect, characterized in that, The device includes: An acquisition unit is used to acquire a spider silk model to be rendered, wherein the spider silk model includes multiple nodes; A stage determination unit is used to determine the current rendering stage, which corresponds to the life stage of the spider silk model. The life stage includes an emission stage, a pulling stage, and a shedding stage. The emission stage is the stage where a virtual object in the game scene emits the spider silk model; the pulling stage is the stage corresponding to when the spider silk model hits a virtual object; and the shedding stage is the stage where the spider silk model is released from the control of the virtual object. A trajectory calculation unit is configured to determine, based on the rendering stage, the motion trajectories of the plurality of nodes calculated using physical simulation and / or non-physical simulation methods, wherein: When the rendering stage corresponds to the emission stage of the spider silk model, the motion trajectory of the multiple nodes is determined to be calculated by a non-physical simulation method. When the rendering stage corresponds to the pulling stage of the spider silk model, the motion trajectory of the multiple nodes is calculated by a combination of non-physical simulation and physical simulation. When the rendering stage corresponds to the unwinding stage of the spider silk model, the motion trajectory of the multiple nodes is determined by physical simulation. The rendering unit is used to render the spider silk model according to the motion trajectory of the multiple nodes to obtain the spider silk effect.

7. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps in the method for implementing the spider silk effect as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the method for implementing the spider silk effect according to any one of claims 1 to 5.