Joint position processing method and device, electronic equipment, computer readable storage medium and computer program product
By simulating the physical drive and vibration direction of the joint chain of virtual objects, the joint position is updated to enrich the dynamic performance, which solves the problem of insufficient simulation of the dynamic effect of the attached structure of virtual objects in the existing technology and improves the visual effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies cannot effectively simulate the dynamic effects of airflow when simulating the dynamic effects of the attached structures of virtual objects, such as hair and clothing, resulting in visual distortion.
By acquiring the joint chain of the virtual object, the joint position is simulated based on the physical driving force, and the position offset of the sub-joint is determined by combining the vibration direction angle and the target amplitude, and the joint position is updated to enrich the dynamic performance.
Without increasing the overhead of complex physical calculations, it improves the dynamic performance and flexibility of virtual objects in the simulated environment, and enhances the visual effects.
Smart Images

Figure CN121582413B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and particularly relates to a joint position processing method and device, electronic equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] In the technical field of animation production and real-time rendering of virtual roles, the dynamic effect of the appendage structure (such as hair, clothes, accessories, etc.) of the virtual role usually needs to be realized through calculation processing.
[0003] In the related art, the processing method mainly simulates the force of the grid vertex or the bone joint of the virtual object through a physical engine to present the motion state of the object in the virtual environment. This scheme often only performs simple one-way force offset on the bone, and cannot simulate the unique dynamic performance of the fabric or hair under the action of the air flow, resulting in distorted visual effects. SUMMARY
[0004] The embodiments of the present application provide a joint position processing method, device, electronic equipment, computer readable storage medium and computer program product, which can enrich the dynamic performance details of the joint chain of the virtual object in the physical driving environment and improve the visual effect.
[0005] The technical scheme of the embodiments of the present application is implemented as follows:
[0006] The embodiments of the present application provide a joint position processing method, which comprises the following steps:
[0007] Obtaining a plurality of joint chains of a virtual object, wherein each joint chain comprises a root joint and at least one sub-joint;
[0008] For each joint in each joint chain, a first position corresponding to the joint is simulated based on the force applied to the joint by a physical driving in a simulation environment, wherein the first position is the position of the joint in the simulation environment;
[0009] For each joint chain, a vibration direction of the joint chain is determined based on a preset vibration direction angle of the joint chain;
[0010] For each sub-joint in the joint chain, a target amplitude of the sub-joint is determined based on the driving strength of the physical driving, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain;
[0011] determine a position offset of the sub-joint based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and update the first position corresponding to the sub-joint based on the position offset of the sub-joint to obtain a second position corresponding to the sub-joint.
[0012] An embodiment of the present application provides a joint position processing device, comprising:
[0013] An obtaining module is configured to obtain a plurality of joint chains of a virtual object, wherein each joint chain comprises a root joint and at least one sub-joint;
[0014] An simulating module is configured to simulate a first position corresponding to each joint in each joint chain based on an acting force of a physical drive applied to the joint in a simulation environment, wherein the first position is a position of the joint in the simulation environment.
[0015] A first determining module is configured to determine a vibration direction of each joint chain based on a preset vibration direction angle of the joint chain.
[0016] A second determining module is configured to determine a target amplitude of each sub-joint in the joint chain based on a driving strength of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain.
[0017] A position updating module is configured to determine a position offset of the sub-joint based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and update the first position corresponding to the sub-joint based on the position offset of the sub-joint to obtain a second position corresponding to the sub-joint.
[0018] An embodiment of the present application provides an electronic device, comprising:
[0019] A memory is configured to store computer executable instructions or computer programs.
[0020] A processor is configured to execute the computer executable instructions or computer programs stored in the memory to implement the joint position processing method provided by an embodiment of the present application.
[0021] An embodiment of the present application provides a computer readable storage medium storing computer programs or computer executable instructions, which are configured to be executed by a processor to implement the joint position processing method provided by an embodiment of the present application.
[0022] The embodiment of the application provides a computer program product, comprising a computer program or computer executable instructions, which, when executed by a processor, implement the joint position processing method provided by the embodiment of the application.
[0023] The embodiment of the application has the following beneficial effects:
[0024] The first positions of the joints are simulated by applying physical driving to the joint chain of the virtual object, and then the vibration direction of the joint chain is determined in combination with the preset vibration direction angle; on this basis, the target amplitude of the sub-joint is determined based on the driving strength of the physical driving, the first position of the sub-joint and the first position of the root joint, and the position offset of the sub-joint is determined in combination with the vibration direction, and finally the first position of the sub-joint is updated to obtain the second position. The embodiment of the application further superimposes the position offset calculated based on the vibration direction, the driving strength and the position relationship on the basis of the first position obtained through physical simulation, which can update the positions of the joints in the joint chain directly by controlling the target amplitude and the vibration direction while retaining the position changes brought by the physical driving, so that the joint chain presents additional dynamic details in the position layer, which can enrich the motion form of the joint chain and improve the expressiveness and flexibility of the virtual object in the simulation environment without increasing the complex physical calculation overhead. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 is an architecture schematic diagram of the joint position processing system provided by the embodiment of the application;
[0026] Figure 2 is a structure schematic diagram of the electronic device provided by the embodiment of the application;
[0027] Figure 3 is a flow schematic diagram of the joint position processing method provided by the embodiment of the application Figure 1 ;
[0028] Figure 4 is a joint chain schematic diagram of a plant provided by the embodiment of the application;
[0029] Figure 5 is a joint chain schematic diagram of a skirt of a virtual role provided by the embodiment of the application;
[0030] Figure 6 is a flow schematic diagram of the joint position processing method provided by the embodiment of the application Figure 2 ;
[0031] Figure 7 is a flow schematic diagram of the joint position processing method provided by the embodiment of the application Figure 3 ;
[0032] Figure 8 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 4 ;
[0033] Figure 9 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 5 ;
[0034] Figure 10 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 6 ;
[0035] Figure 11 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 7 ;
[0036] Figure 12 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 8 ;
[0037] Figure 13 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 9 ;
[0038] Figure 14 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 10 ;
[0039] Figure 15 is a flowchart of a joint position processing method provided by an embodiment of the present application Figure 10 is a flowchart of a joint position processing method provided by an embodiment of the present application
[0040] Figure 16 is a schematic diagram of a plug-in interface provided by an embodiment of the present application
[0041] Figure 17 is a schematic diagram of an editor interface provided by an embodiment of the present application
[0042] Figure 18 is a flowchart of a joint simulation animation provided by an embodiment of the present application
[0043] Figure 19 is a flowchart of a joint waveform generation provided by an embodiment of the present application
[0044] Figure 20 is a schematic diagram of a parameter configuration panel provided by an embodiment of the present application
[0045] Figure 21 is a schematic diagram of a waveform parameter list provided by an embodiment of the present application
[0046] Figure 22is a schematic diagram of a coordinate system with the root joint as the origin provided by an embodiment of the present application;
[0047] Figure 23 is a schematic diagram of an amplitude intensity curve provided by an embodiment of the present application;
[0048] Figure 24 is a hair wave animation schematic diagram provided by an embodiment of the present application;
[0049] Figure 25 is a schematic diagram of the calculation of the vibration direction angle provided by an embodiment of the present application;
[0050] Figure 26 is an effect diagram of the wave under different environmental wind forces provided by an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be described in further detail below with reference to the drawings, and the described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those skilled in the art without making creative efforts fall within the scope of protection of the present application.
[0052] In the following description, "some embodiments" are described, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0053] In the following description, the terms "first\second\third" are only to distinguish similar objects, and do not represent a specific order of the objects, and it can be understood that "first\second\third" can be interchanged with a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0054] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.
[0055] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0056] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0057] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0058] 1) Virtual objects: refer to digital entities that exist and can be interacted with in computer-generated virtual scenes, including but not limited to virtual characters (Avatar), non-player characters (NPC), virtual creatures, or virtual objects with skeletal structures (such as swaying plants, fluttering flags, character hair, etc.).
[0059] 2) Joint chain: refers to the chain-like structure formed by multiple joints connected in sequence in the skeletal hierarchy of a virtual object. The joint chain usually starts from a root joint and extends to one or more terminal child joints. It is often used to drive the attachment parts of the virtual object, such as hair, tail, hem, ribbon, etc.
[0060] 3) Simulation environment: refers to the virtual space built in a computer program for running physical simulation calculations. Force fields (such as gravity and wind fields), collision bodies and other physical rules can be configured in this space to calculate the motion trajectory of virtual objects under force conditions.
[0061] 4) Physics-driven: refers to the process of applying external forces (such as wind, impact, inertial force, etc.) or environmental constraints in a simulated environment to cause changes in the motion state of the joints of virtual objects, such as displacement and rotation.
[0062] 5) Skeletal Animation: A computer animation technique that uses changes to the transformation properties (position, rotation, scaling) of bones (or joints) to drive the deformation of the mesh model attached to the bones, thereby producing continuous dynamic images.
[0063] 6) Position Based Dynamics (PBD): A technique that simulates physical motion by directly constraining the positional relationships of objects (rather than solving for forces and accelerations). It is often used for flexible bodies such as fabric and hair, balancing efficiency and physical reliability.
[0064] 7) Sine function: a periodic mathematical function, a kind of trigonometric function, used to describe the periodic fluctuation law varying with time or space, used to generate smooth and regular oscillation data by algorithm to drive the joints to produce wave-like reciprocating motion.
[0065] 8) Human-computer interaction interface: an interface used to provide human-computer interaction functions, which can be the parameter configuration panel of the animation editor, the node editor interface of the game engine, or the runtime dynamic debugging interface in the embodiments of the present application. The user can specify the joint chain structure of the virtual object (such as inputting the root joint and the end joint index), set the environmental force field parameters (such as wind speed and direction), or adjust the waveform control parameters (such as wavelength and wave speed mapping relationship) through the interface. The interface forms, for example, a graphical user interface (Graphical User Interface, GUI) display, such as an augmented reality (Augmented Reality, AR) interface, a virtual reality (Virtual Reality, VR) interface, a voice user interface (Voice User Interface, VUI), an interactive projection interface (using projection technology to display information on a plane), an eye movement detection interface (an interface controlled by detecting the user's visual line), a holographic interface (a three-dimensional holographic image formed by holographic projection technology, without the need to wear special glasses to see a stereoscopic image), a multi-modal interface (an interactive interface combining multiple interaction modes such as touch, vision, and hearing), a brain-computer interface (Brain-Machine Interface, BMI) interface, etc.
[0066] In order to enhance the picture performance of games and animations, developers often need to show the dynamic swinging effect of virtual objects (such as vegetation, grass, hair, clothes, etc.) under the action of environmental wind field and other external forces. In the related art, the animation generation schemes are mainly divided into the following categories, and each has certain limitations: pivot point (Pivot) driven rotation scheme: this type of scheme is usually used for approximate simulation of multi-branch structures such as trees, and is not based on real joint structure or physical mechanics, so when dealing with flexible long-chain structures such as character hair or clothes, it is difficult to show natural coherence and physical realism. Joint rotation control scheme: this scheme mainly controls the rotation angle of the joint to realize the animation, and the control logic is not intuitive enough. If you want the end to reach a specific target position (for example, swing to a certain point with the wind), you need to calculate the local rotation amount of each parent joint through a complex inverse dynamics algorithm, which increases the complexity and performance overhead of the algorithm.
[0067] To solve the above problems, the embodiment of the present application provides a joint position processing method and device, electronic equipment, computer readable storage medium and computer program product, which can enrich the dynamic performance details of the joint chain of the virtual object in the physical driving environment, and improve the visual interaction effect. The following describes the exemplary application of the electronic equipment provided by the embodiment of the present application. The electronic equipment provided by the embodiment of the present application can be implemented as a notebook computer, a tablet computer, a desktop computer, a set-top box, a smart phone, a smart speaker, a smart watch, a smart television, a vehicle-mounted terminal, and various types of terminals. It can also be implemented as a server. The following will illustrate the exemplary application when the device is implemented as a terminal or a server.
[0068] Referring to Figure 1 , Figure 1 is the architecture diagram of the joint position processing system provided by the embodiment of the present application. To support the position processing application of a joint, the joint position processing system 100 at least includes a terminal 400, a network 300 and a server 200. The terminal 400 is connected to the server 200 through the network 300, and the network 300 can be a wide area network or a local area network, or a combination of the two. In some embodiments, the server 200 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. Basic cloud computing services. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
[0069] In some embodiments, the present application embodiments can be implemented by the terminal 400 alone. For example, the terminal 400 runs a virtual application (such as a mobile game or animation editor) and obtains multiple joint chain data of a virtual object (such as a game character); for each joint in each joint chain, the terminal 400 simulates the first position corresponding to the joint based on the force applied to the joint by the physical drive in the simulated environment, wherein the first position is the position of the joint in the simulated environment; for each joint chain, the terminal 400 determines the vibration direction of the joint chain based on a preset vibration direction angle for the joint chain; for each sub-joint in the joint chain, the terminal 400 determines the target amplitude of the sub-joint based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain; the terminal 400 determines the position offset of the sub-joint based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and updates the first position corresponding to the sub-joint based on the position offset of the sub-joint to obtain the second position corresponding to the sub-joint. The terminal 400 drives the mesh model of the virtual object to render based on the updated second position, and presents an animation with a wave dynamic effect on the display screen of the terminal 400.
[0070] In some embodiments, the present application can be implemented collaboratively by a server and a terminal. A user interacts with an animation editor via a terminal 400. The terminal 400 receives multiple joint chains of a virtual object selected by the user and the drive strength of the physical drive set by the user. It encapsulates the multiple joint chains of the virtual object and the drive strength of the physical drive into a joint position processing request and transmits it to the server 200 via the network 300. In response to a received joint position processing request, server 200 acquires multiple joint chains of a virtual object, where each joint chain includes a root joint and at least one child joint. For each joint in each joint chain, server 200 simulates a first position corresponding to the joint based on the force applied to the joint by physical drives in the simulated environment, where the first position is the joint's position in the simulated environment. For each joint chain, server 200 determines the vibration direction of the joint chain based on a preset vibration direction angle. For each child joint in the joint chain, server 200 determines the target amplitude of the child joint based on the driving intensity of the physical drives, the first position corresponding to the child joint, and the first position corresponding to the root joint in the joint chain. Based on the target amplitude of the child joint and the vibration direction of the joint chain, server 200 determines the position offset of the child joint and updates the first position corresponding to the child joint based on the position offset, obtaining a second position corresponding to the child joint. Server 200 sends the second position to terminal 400, which drives the rendering of the virtual object's mesh model based on the updated second position and displays an animation with a wave-like dynamic effect on the terminal 400's display screen.
[0071] The joint position processing method provided by the embodiments of the present application can be applied to any scene requiring real-time dynamic simulation of parts (such as hair, fabric, tail, etc.) of a virtual object, to significantly improve the physical realism and dynamic performance of the picture while ensuring high-performance operation. The specific application scenarios can be:
[0072] 1) High-quality mobile game: A user runs an open-world role-playing game on a mobile device (such as a smartphone or tablet). When the player controls the character to gallop on the prairie, the character's long hair and cape behind the character are not only affected by the running inertia of the character (physical driving), but also affected by the blowing of the environmental wind field in the scene. The terminal uses the joint position processing method provided by the embodiments of the present application to superimpose dynamic details based on physical driving numbers on the basis of physical simulation, so that the hair and cape can also present a delicate, smooth and regular wave effect without complex aerodynamic calculation, thereby improving the visual immersion of the game and ensuring the smooth frame rate of the game on the mobile device.
[0073] 2) Virtual reality (Virtual Reality, VR) virtual interaction experience: A user wears a VR headset into a virtual underwater exploration application. There are a large number of seaweed, soft body tentacles and user virtual avatar diving suit pipelines in the scene. Based on the external driving condition of "water flow", the dynamic effect of these flexible objects flowing with the waves in the water is generated in real time. Compared with traditional rigid bone animation, the wave motion generated by the embodiments of the present application is more natural and soft; compared with complex fluid simulation, the extremely low computational overhead of the embodiments of the present application can effectively avoid frame drop and lag in VR rendering, thereby reducing the user's dizziness.
[0074] 3) Animation production and instant calculation: When an animator uses a three-dimensional animation editing tool to produce a plot scene animation, the animator needs to add wind blowing effect to the long skirt of the character. In the traditional key frame production process, the animator needs to manually adjust the rotation angle of each frame of the skirt bone, which is a huge workload. In the embodiments of the present application, the animator only needs to specify the root joint and the child joint of the end of the skirt in the configuration panel, and set the wind strength parameter to be simulated, so as to automatically construct the joint chain, and combine the physical simulation and the programmed wave algorithm to calculate the wave animation of the skirt blowing in the wind in real time. The animator can directly record the calculation result as the final animation data, which greatly improves the efficiency of animation production.
[0075] 4) Virtual digital person live broadcast: in the scene of real-time live broadcast of a virtual host, the virtual image of the host usually contains rich clothing details (such as ribbons, tassels). In order to enhance the interactivity of the live room, the swing amplitude of the virtual image clothing can be adjusted in real time according to the audience's rewards or the hotness of the bullet screen (as external driving strength). For example, when the bullet screen bursts, the driving strength is mapped to a high value, and the virtual image ribbon is driven to produce a vigorous and happy swing effect. This lightweight dynamic generation scheme can stably run on the live streaming end of the live broadcast, enhancing the expressiveness and interactive interest of the virtual host.
[0076] In some embodiments, the electronic device implementing the joint position processing method provided by the embodiments of the application can be a terminal 400 in Figure 1 Figure 2 , Figure 2 is a structural schematic diagram of an electronic device provided by the embodiments of the application, Figure 2 The electronic device shown in the figure includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the electronic device are coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection communication between the components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, all kinds of buses are marked as the bus system 440 in the figure. Figure 2
[0077] The processor 410 can be an integrated circuit chip with signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor.
[0078] The user interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons and controls.
[0079] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 optionally includes one or more storage devices physically located in proximity to the processor 410.
[0080] The memory 450 includes volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. The nonvolatile memory can be read only memory (ROM), and the volatile memory can be random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0081] In some embodiments, the memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, which are exemplarily illustrated below.
[0082] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks.
[0083] The network communication module 452 is used to communicate with other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including Bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB), and the like.
[0084] The presentation module 453 is used to enable the presentation of information via one or more output devices 431 (e.g., display screens, speakers, and the like) associated with the user interface 430 (e.g., user interfaces for operating peripheral devices and displaying content and information).
[0085] The input processing module 454 is used to detect and interpret one or more user inputs or interactions from one or more input devices 432.
[0086] In some embodiments, the device provided by the embodiments of the present application can be implemented in software, Figure 2 A joint position processing apparatus 455 stored in the memory 450 is shown, which can be software in the form of programs and plug-ins, including the following software modules: an acquisition module 4551, a simulation module 4552, a first determination module 4553, a second determination module 4554, and a position updating module 4555. These modules are logical, and thus can be combined or further split according to the implemented functions. The functions of each module will be described below.
[0087] In some embodiments, a terminal or a server can implement the joint position processing method provided by the embodiments of the present application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. The computer programs can be native programs or software modules in an operating system; can be native applications (APPlications, APPs) that need to be installed in an operating system to run, such as live broadcast APPs; or can be small programs that can be embedded into any APP, that is, programs that only need to be downloaded into a browser environment to run. In summary, the above computer-executable instructions can be any form of instructions, and the above computer programs can be any form of application programs, modules, or plug-ins.
[0088] Next, the joint position processing method provided by the embodiments of the present application is described. As described above, the electronic device that implements the joint position processing method of the embodiments of the present application can be a terminal, a server, or a combination of the two. Therefore, the execution subject of each step will not be repeated in the following description.
[0089] Referring to Figure 3 , Figure 3 is a flowchart of the joint position processing method provided by the embodiments of the present application Figure 1 , the steps shown in Figure 3 will be described. As shown in Figure 3 , the method includes the following steps 101 to 105.
[0090] In step 101, a plurality of joint chains of a virtual object are obtained.
[0091] Each joint chain includes a root joint and at least one child joint.
[0092] Here, the virtual object is an interactive digital entity existing in a computer simulation environment, including but not limited to a game character, an NPC, or a scene object with a skeletal animation structure. The joint chain is a chain structure formed by joints in parent-child relationship in the skeletal structure of the virtual object, which can be used to simulate flexible objects such as hair, tail, rope, clothing, etc. The root joint is the highest level starting joint in the joint chain, which can be attached to the main torso of the virtual object. The child joint is all other joints in the joint chain except the root joint.
[0093] An exemplary Figure 4 is a plant joint diagram provided by the embodiments of the present application. Referring to Figure 4Taking a virtual object as a plant as an example, the skeletal structure of the plant 401 includes a main stem and multiple leaf branches attached to the main stem. The joint where the leaf branches connect to the main stem is considered a root joint 402. This joint chain starts from the root joint and extends along the petiole to the sub-joint 403 at the tip of the leaf. This joint chain includes three sub-joints: sub-joint 404, sub-joint 405, and sub-joint 403.
[0094] For example, Figure 5 This is a schematic diagram of the joint chain of the skirt of a virtual character provided in an embodiment of this application. See also... Figure 5 Taking a virtual character wearing a long skirt as an example, the skirt of this character 501 is composed of multiple hanging joint chains arranged around the waist. The root joints of these joint chains are evenly distributed at the waist of the character, forming a closed structure. Each joint chain is considered as a root joint 502 at the joint where it connects to the waist of the character. The joint chain starts from the root joint 502 and extends vertically downwards along the skirt fabric to the sub-joint 503 at the end of the skirt hem. Figure 5 The image shows multiple parallel joint chains that work together to support the physical shape of the entire skirt.
[0095] In some embodiments, multiple joint chains of a virtual object can be obtained by reading a preset configuration file or by responding to real-time input from a user on a human-computer interaction interface (such as the parameter configuration panel of an animation editor).
[0096] In some embodiments, see Figure 6 , Figure 6 The step 101, which involves obtaining a virtual object, may include steps 1011 through 1013.
[0097] In step 1011, configuration data for the joint chain of the virtual object is received.
[0098] The configuration data includes multiple sets of joint pair information, and each set of joint pair information includes a starting joint identifier and an ending joint identifier.
[0099] Here, the configuration data is a dataset used to define the joint chains in the virtual object that need to participate in dynamic waveform simulation. It can be in the form of a list, array, or key-value pairs. Joint pair information is the basic unit of the configuration data, used to characterize the start and end range of an independent joint chain. The starting joint identifier is a unique identifier for the root joint in the joint chain, and can include at least one of the following: numbers, Chinese characters, English letters, and symbols. The ending joint identifier is a unique identifier for a specific sub-joint in the joint chain. The ending joint identifier can include at least one of the following: numbers, Chinese characters, English letters, and symbols.
[0100] In some embodiments, the joint position processing system can receive the configuration data in various ways. For example, the configuration data can be received through offline configuration. A developer manually fills in the joint pair information corresponding to the joint chain that needs to be dynamically simulated in the human-computer interaction interface of the animation editor, to obtain the configuration data. Another way is to generate dynamically at runtime, that is, to automatically scan and generate configuration data according to a preset naming rule (for example, all joints starting with “Skirt_”).
[0101] It should be noted that after the user specifies the starting joint identifier of the root joint, the user can specify the identifier of any child joint in any joint chain starting from the root joint as the terminal joint identifier. For example, there is an initial joint chain in the skeletal structure of a virtual object: root joint A -> child joint B -> child joint C -> child joint D, and the user can fill in the terminal joint identifier as child joint B, so that child joint B is the last child joint of the joint chain, and the joint chain is root joint A -> child joint B.
[0102] For example, referring to Figure 5 , the user inputs configuration data in the animation parameter configuration panel. The configuration data contains multiple sets of joint pair information, each corresponding to a joint chain of a sagging bone of the skirt. For example, for a joint chain on the side, the user can input the first set of joint pair information as {starting joint identifier: 502, terminal joint identifier: 503}, or the user can input the first set of joint pair information as {starting joint identifier: 502, terminal joint identifier: 504}.
[0103] In step 1012, for each set of joint pair information, the joint corresponding to the starting joint identifier in the joint pair information is determined as the root joint, and the joint corresponding to the terminal joint identifier is determined as the last child joint in the joint chain.
[0104] In some embodiments, after receiving the configuration data, for each set of joint pair information in the configuration data, the joint corresponding to the starting joint identifier in the joint pair information is found in the skeletal hierarchy list or hash table of the virtual object based on the starting joint identifier, and the joint is taken as the root joint. If the joint pair information includes a terminal joint identifier, the joint corresponding to the terminal joint identifier is found in the skeletal hierarchy list or hash table of the virtual object based on the terminal joint identifier, and the joint is taken as the last child joint. If the terminal joint identifier in the joint pair information is empty, the root joint is traversed until a joint without a next level child joint is found, and the joint is taken as the last child joint.
[0105] For example, referring to Figure 5If the first joint pair information in the configuration data is {start joint identifier: 502, end joint identifier: 504}, the root joint 502 with identifier 502 and the last child joint 504 with identifier 504 are found in the bone tree of the virtual object. Alternatively, if the first joint pair information input by the user is {start joint identifier: 502, end joint identifier: null}, the root joint 502 with identifier 502 is found in the bone tree of the virtual object, and the joint 503 without a next level child joint is found by traversing downward from the root joint 502, and the joint 503 is taken as the last child joint.
[0106] In step 1013, a joint chain corresponding to the joint pair information is constructed based on the hierarchical connection relationship between the root joint and the last child joint.
[0107] Here, the hierarchical connection relationship is the parent-child tree data structure relationship between the bones. Constructing the joint chain means extracting all the joints on the path from the root to the end and storing them in a linear array or linked list structure in order.
[0108] In some embodiments, constructing the joint chain corresponding to the joint pair information based on the hierarchical connection relationship between the root joint and the last child joint can be achieved by the following method: starting from the last child joint, finding the parent node of the last child joint by accessing it, and finding the root joint by level by level upward, obtaining a path. All joints on the path are stored in the joint chain list in order from the root to the end (forward order), and the joint chain corresponding to the joint pair information is obtained.
[0109] For example, referring to Figure 5 Starting from the last child joint 503, the next level parent joint, the parent joint of the next level, and so on are found in turn until the root joint 502 is traced back to obtain a path. All joints on the path are packaged into a joint chain named Chain_01 in order.
[0110] The embodiment of the application realizes high flexibility and automation of the joint chain construction process by adopting the technical scheme of receiving configuration data and constructing a joint chain based on the start joint identifier and the end joint identifier in the joint pair information in the configuration data. Through the multiple sets of joint pair information in the configuration data, the joint chain that needs to be processed in position by physical driving can be accurately specified. Specifically, based on the directional construction mechanism of the joint identifier, the joint chain in a linear structure can be quickly extracted from a complex skeletal hierarchical structure through hierarchical connection relationship backtracking, without traversing irrelevant skeletal nodes that are not identified, which not only reduces the data processing overhead in the physical simulation initialization stage, but also effectively avoids non-target joints (such as rigid skeletons that do not need a wave effect, such as a character's torso) from being incorrectly included in the position update process, thereby improving the accuracy and calculation efficiency of physical driving target selection. At the same time, through the flexible configuration mode defined by the start joint identifier and the end joint identifier, the skeletal topological structure of different virtual objects can be adapted, and the universality of the joint position processing method is enhanced.
[0111] In step 102, for each joint in each joint chain, a first position corresponding to the joint is simulated based on an acting force of a physical driving in a simulation environment applied to the joint.
[0112] The first position is the position of the joint in the simulation environment.
[0113] Here, the simulation environment refers to a virtual three-dimensional space constructed in a computer program for carrying virtual objects and performing physical and mechanical calculations. The simulation environment not only includes a geometric coordinate system definition, but also integrates a series of physical rules and environment parameters for simulating physical phenomena in the real world. The physical driving is a preset external factor in the simulation environment that can have a mechanical effect on the virtual object, including but not limited to a constant force field (such as gravity), an environmental force field (such as a wind field with a specific direction and intensity, a water flow field), and an inertial force generated by the motion of the virtual object itself. The first position is the spatial coordinate obtained by a physical integration algorithm after the joint is subjected to the acting force of the above physical driving at the current time. The first position reflects the macroscopic physical motion trend of the joint (such as being blown up by the wind, swinging with inertia), but has not yet superimposed the programmed periodic wave details.
[0114] In some embodiments, simulating the first position of each joint in each joint chain based on the force applied to the joint by the physical drive in the simulation environment can be achieved by: calculating the force applied to each joint by the physical drive at the current time (e.g., the vector sum of gravity and wind force) based on a Spring-Mass System or a Position-Based Dynamics (PBD) framework; and integrating the force and the position and velocity of the joint at the previous time to calculate the first position of the joint at the current time.
[0115] Continuing with the above skirt scenario, assume that the physical drive in the simulation environment is a lateral wind field with a wind speed of 5 m / s. In step 102, the physics engine calculates the thrust of the wind on each joint chain of the skirt. The naturally drooping skirt skeleton is blown to one side by the combined action of the wind and gravity. At this time, the calculated coordinates (first positions) of each joint present a parabolic shape after being blown by the wind.
[0116] In step 103, for each joint chain, the vibration direction of the joint chain is determined based on the preset vibration direction angle of the joint chain.
[0117] Here, the vibration direction angle is a preset scalar angle value used to define the degree of deflection of the swing plane of the joint chain relative to the reference frame of the joint chain when the joint chain is performing microscopic wave swinging. The preset vibration direction angle of each joint chain can be the same or different. The vibration direction is the specific spatial vector direction in which the sub-joints in the joint chain are displaced from the root joint when the periodic wave is superimposed.
[0118] In some embodiments, determining the vibration direction of each joint chain based on the preset vibration direction angle of the joint chain can be achieved by: determining the vibration direction of the joint chain based on the preset vibration direction angle of the joint chain, the first position of the root joint, and the first position of at least one sub-joint in the joint chain.
[0119] In some embodiments, referring to Figure 7 , Figure 7 determining the vibration direction of each joint chain based on the preset vibration direction angle of the joint chain in step 103 can include the following steps 1031 to 1033.
[0120] In step 1031, for each joint chain, a coordinate system with the root joint in the joint chain as the origin is determined.
[0121] Here, the longitudinal axis of the coordinate system is in the direction of the root joint pointing to the first sub-joint in the joint chain.
[0122] Here, the coordinate system is a three-dimensional local reference frame with the root joint as the spatial origin, and composed of mutually perpendicular horizontal axis, vertical axis and vertical axis, used to describe the spatial posture of the joint chain relative to itself. The vertical axis is the axial direction defined along the hierarchical connection direction of the joint chain in the coordinate system, representing the main extension dimension from the root joint to the first child joint. The first child joint is the joint at the next level adjacent to the root joint in the hierarchical structure of the joint chain. When connecting the root joint and the first child joint with a line segment, the direction of the line segment represents the direction of the vertical axis.
[0123] In some embodiments, the first position of the root joint and the first position of the first child joint calculated by the physics engine are read, a vector from the root joint to the first child joint is constructed, and the vector is normalized to determine the vertical axis of the coordinate system. Subsequently, in combination with the preset auxiliary vector or the original rotation attribute of the root joint, the horizontal axis and the vertical axis perpendicular to the vertical axis are determined through vector cross multiplication operation, thereby constructing the complete coordinate system.
[0124] For example, referring to Figure 5 For the joint chain, taking the position of the root joint 502 as the origin, since the joint 505 is the first child joint directly connected to the root joint 502, a vector from the root joint 502 to the child joint 505 is calculated, and the vector is defined as the vertical axis (usually the Z axis) of the coordinate system, thereby establishing the direction of the entire coordinate system.
[0125] In step 1032, a main orientation of the joint chain is determined based on the first position corresponding to the root joint and the first position corresponding to at least one child joint in the joint chain.
[0126] Here, the main orientation is a three-dimensional vector reflecting the overall extension trend or average pointing direction of the joint chain in the current physical simulation state, used as a normal reference for subsequent calculation of the projection plane.
[0127] In some embodiments, the determination of the main orientation of the joint chain based on the first position corresponding to the root joint and the first position corresponding to at least one child joint in the joint chain in step 1032 can be achieved by the following methods: determining a first direction from the first position corresponding to the root joint to the first position corresponding to the first child joint as the main orientation; or determining a second direction from the first position corresponding to the root joint to the first position corresponding to the last child joint of the joint chain as the main orientation; or determining a third direction from the first position corresponding to the root joint to the first position corresponding to each child joint in the joint chain, and determining the average of the plurality of third directions as the main orientation.
[0128] Here, the first direction is a straight line vector in the simulation environment, pointing from the first position of the root joint to the first position of the first directly connected sub-joint. The second direction is a span vector directly pointing from the first position of the root joint to the first position of the last sub-joint, reflecting the overall connection of the head and tail of the joint chain. The third direction is a vector pointing from the root joint to any sub-joint in the joint chain.
[0129] In some embodiments, the first position of the root joint is first acquired. If the first mode is adopted, the first position of the first sub-joint is acquired, a vector subtraction operation is performed on the first position of the root joint and the first position of the first sub-joint to obtain the first direction, and the first direction is normalized as the main orientation. If the second mode is adopted, the last sub-joint is found by traversing the joint chain, the first position of the last sub-joint is acquired, and the displacement vector of the first position of the last sub-joint relative to the root joint is calculated as the second direction, i.e., the main orientation. If the third mode is adopted, all sub-joints in the joint chain are traversed, the third direction of each sub-joint relative to the root joint is calculated one by one, and the average vector obtained by averaging all third directions is taken as the main orientation.
[0130] For example, taking a skirt as an example, Figure 5 If the first mode is selected, the vector pointing from the root joint 502 to the sub-joint 505 is calculated, and the main orientation mainly reflects the tangent direction of the root of the skirt. If the second mode is selected, the vector pointing from the root joint 502 to the last sub-joint 503 is calculated, and the main orientation reflects the average inclination angle of the whole skirt. If the third mode is selected, the average of all vectors pointing to the sub-joints 504, 505 and 503 is calculated, and the main orientation reflects the direction of the center of gravity distribution of the whole skirt after bending.
[0131] The embodiments of the present application provide multiple optional modes for calculating the main orientation based on the first positions of the root joint and sub-joints at different levels, enhancing the adaptability of the algorithm to different morphological joint chains. The first direction is used as the main orientation for joint chains that are relatively strong or short, the calculation overhead is minimized, and the root posture can be accurately captured; the second direction is used for long and straight joint chains, which can quickly reflect the overall trend; the average of multiple third directions is used for extremely flexible or complexly curled joint chains, which can smooth out the direction jitter caused by local bending, so as to calculate a more stable and more representative main orientation, providing a reliable data basis for subsequent accurate construction of the projection plane.
[0132] In step 1033, the vibration direction of the joint chain is determined based on the main orientation, the coordinate system, and the vibration direction angle.
[0133] In some embodiments, determining the vibration direction of the joint chain based on the main orientation, the coordinate system, and the vibration direction angle can be achieved by constructing an orthogonal projection plane according to the main orientation. A preset reference horizontal axis (for example, only the X axis) is directly selected from the coordinate system. The orthogonal projection of the reference horizontal axis on the projection plane is calculated to obtain a reference vibration direction. The reference vibration direction is rotated by a preset vibration direction angle with the main orientation as the rotation axis. If the vibration direction angle is positive, the rotation is in the right-hand rule direction; if it is negative, the rotation is in the opposite direction, and the final vector obtained is the vibration direction.
[0134] For example, referring to Figure 5 , a cross section (projection plane) perpendicular to the main orientation is established, only the X axis of the root joint 502 coordinate system is obtained as the reference horizontal axis, and the reference vibration direction is obtained by projecting it onto the cross section. A rotation matrix is constructed which rotates by a preset vibration direction angle around the main orientation. The reference vibration direction is transformed based on the rotation matrix to obtain the final vibration direction.
[0135] The embodiments of the present application can determine the vibration direction by constructing a coordinate system with the root joint in the joint chain as the origin and combining the real-time calculated main orientation, which can solve the problem that the coordinate system with the root joint as the origin does not match the overall shape of the joint chain when the joint chain undergoes a large physical displacement (such as being bent by the wind). The coordinate system determined by the root joint and the first sub-joint provides a stable local reference, and the main orientation dynamically calculated based on the first position accurately reflects the current actual bending posture of the joint chain. By projecting the axes of the coordinate system in the plane perpendicular to the main orientation and correcting based on the vibration direction angle, it is ensured that the finally determined vibration direction is always orthogonal to the main orientation of the joint chain, avoiding the non-natural axial stretching or compression of the joint chain caused by wave vibration, thereby ensuring the geometric correctness and visual naturalness of the animation deformation.
[0136] In some embodiments, referring to Figure 8 , Figure 8 determining the vibration direction of the joint chain based on the main orientation, the coordinate system, and the vibration direction angle in step 1033 can include the following steps 10331 to 10333.
[0137] In step 10331, the first plane axis and the second plane axis of the coordinate system are obtained.
[0138] The first plane axis and the second plane axis are perpendicular to the longitudinal axis, respectively.
[0139] Here, the first plane axis can be a horizontal axis (for example, the X axis) in the coordinate system which is perpendicular to the longitudinal axis. The second plane axis can be a vertical axis (for example, the Y axis) in the coordinate system which is perpendicular to the longitudinal axis and the first plane axis.
[0140] For example, referring to Figure 5For example, for the skirt in FIG. 1, the coordinate system with the root joint 502 as the origin is read. Assuming the longitudinal axis is the Z axis pointing to the ground, the X axis pointing to the right side of the body is obtained as the first plane axis, and the Y axis pointing to the front of the body is obtained as the second plane axis.
[0141] In step 10332, a projection plane perpendicular to the main orientation is determined, and the projection direction of the first plane axis on the projection plane is determined as the first secondary orientation of the joint chain, and the projection direction of the second plane axis on the projection plane is determined as the second secondary orientation of the joint chain.
[0142] Here, the projection plane refers to a geometric plane passing through the origin of the coordinate system and perpendicular to the main orientation. The first secondary orientation is the vector projection of the first plane axis on the projection plane, representing a main geometric direction of the joint chain section. The second secondary orientation is the vector projection of the second plane axis on the projection plane, representing an auxiliary geometric direction of the joint chain section.
[0143] In some embodiments, the main orientation is taken as the normal of the projection plane. The vector projection formula is used to calculate the projection vector of the first plane axis on the projection plane and the projection vector of the second plane axis on the projection plane, respectively, where is the axis vector to be projected, is the projection vector after projection. The two projection vectors are normalized to obtain the first secondary orientation and the second secondary orientation in the form of unit vectors.
[0144] For example, the skirt is blown to the right side, and the main orientation is tilted to the right. A tangent plane (projection plane) perpendicular to the tilted main orientation is constructed. The first plane axis pointing to the right side is projected onto the tangent plane to obtain the first secondary orientation pointing to the right side along the tangent plane; the second plane axis pointing to the front of the body is projected onto the tangent plane to obtain the second secondary orientation pointing to the front along the tangent plane. The two secondary orientations reconstruct a two-dimensional coordinate system on the tangent plane that fits the current posture of the skirt.
[0145] In step 10333, the first secondary orientation is rotated in the projection plane according to the vibration direction angle to the second secondary orientation, and the rotated first secondary orientation is determined as the vibration direction of the joint chain.
[0146] Here, rotation refers to a geometric transformation operation that keeps the vector length unchanged and changes the vector pointing angle in a two-dimensional plane.
[0147] In some embodiments, in the projection plane, the first secondary orientation is taken as the reference edge, the direction pointing to the second secondary orientation is taken as the positive rotation direction, and the trigonometric function formula is used: where the first secondary orientation, the second secondary orientation, the vibration direction angle, to calculate the vibration direction .
[0148] In some embodiments, a rotation matrix is constructed to rotate the vibration direction angle around the main orientation, and the first secondary orientation is transformed based on the rotation matrix, and the calculated vector is the vibration direction of the joint chain.
[0149] For example, on the bevel surface, the first secondary orientation pointing to the right is taken as the starting point. If the preset vibration direction angle is 45 degrees, the second secondary orientation pointing forward is rotated by 45 degrees. Finally, a vector (vibration direction) pointing to the right front is obtained. This ensures that the wave effect of the skirt will fluctuate along this specific bevel angle.
[0150] The embodiment of the present application provides a vibration direction determination scheme based on coordinate system biaxial projection and directional rotation, which significantly improves the geometric stability and controllability of the wave effect of the joint chain in complex motion states. The embodiment of the present application does not simply rely on a single reference axis, but obtains a first plane axis and a second plane axis perpendicular to the longitudinal axis, respectively, and projects the two axes onto a projection plane perpendicular to the main orientation, to construct a dynamic two-dimensional base composed of the first secondary orientation and the second secondary orientation. This design not only solves the consistency problem of the original coordinate axis when the joint chain is bent sharply, but also eliminates the ambiguity of the rotation direction by introducing the second secondary orientation as a clear rotation reference target. By rotating the first secondary orientation on this base according to the preset vibration direction angle, it can be ensured that the finally determined vibration direction always accurately fits the current physical cross section of the joint chain, and can flexibly adapt to various asymmetric skeletal shape requirements, thereby avoiding the wave vibration direction from appearing counter-intuitive flipping or interleaving, and ensuring the high quality and robustness of the animation performance.
[0151] In step 104, for each sub-joint in the joint chain, a target amplitude of the sub-joint is determined based on a driving strength of a physical drive, a first position corresponding to the sub-joint, and a first position corresponding to a root joint in the joint chain.
[0152] Here, the target amplitude is a spatial displacement amplitude value that the sub-joint should generate at the current time to represent the programmed wave feature. The driving strength can be a scalar parameter quantifying the intensity of the physical drive (such as wind field, water flow), used to dynamically adjust the morphology of the wave. Taking the physical drive as a wind field as an example, the driving strength can be the wind speed, wind force, etc. of the wind field.
[0153] In some embodiments, for each sub-joint in the joint chain, the target amplitude of the sub-joint is determined based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain. This can be achieved as follows: First, the current driving intensity is read from the physics engine or environment settings. Then, for each sub-joint, the first position after physical simulation is obtained, and the first position of the root joint of the joint chain is obtained. The distance between the two is calculated using vector subtraction and modulus calculation. A preset wave generation algorithm module is called, using this distance and the current time as input variables, combined with the waveform parameters modulated by the driving intensity, to calculate the periodic value that varies with time and space. This periodic value is determined as the target amplitude of the sub-joint.
[0154] In some embodiments, see Figure 9 , Figure 9 The step 104 shows that for each sub-joint in the joint chain, the target amplitude of the sub-joint is determined based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain. This may include steps 1041 to 1043.
[0155] In step 1041, based on the driving intensity of the physical drive, the initial waveform parameter values are determined, and the initial waveform parameter values are randomly offset to obtain the shared waveform parameter values of the joints in the joint chain.
[0156] Here, the initial waveform parameter values are a set of reference wave parameters obtained by looking up a table or calculating based on the current driving intensity, which may include the initial wavelength, initial wave velocity, and initial base amplitude. The shared waveform parameter values are a final set of parameters that, after randomization, are assigned to a specific joint chain and are common to all joints within that joint chain.
[0157] In some embodiments, a set of standard initial waveform parameter values is calculated based on the driving intensity through a preset mapping relationship. The initial waveform parameter values are randomly offset to obtain shared waveform parameter values for the joints in the joint chain. This can be achieved by generating a unique random seed for the currently processed joint chain, which can be based on the joint chain's identifier or the world coordinates of the root joint. Using this random seed, random coefficients (e.g., between 0.8 and 1.2) are generated for wavelength, wave velocity, and amplitude. The initial waveform parameter values are multiplied by the corresponding random coefficients to obtain the shared waveform parameter values unique to that joint chain.
[0158] by Figure 5Taking a skirt as an example, the skirt has 10 hanging joint chains. Assume the initial waveform parameter value corresponding to the wind force has a wave speed of 2.0. When processing the first joint chain, a random offset coefficient of 0.9 is generated, resulting in a wave speed of 1.8 in the shared waveform parameter value for that chain. When processing the second joint chain, the random coefficient is 1.1, and the wave speed becomes 2.2. In this way, different parts of the skirt swing at different speeds, avoiding mechanical synchronous swaying.
[0159] In some embodiments, the initial waveform parameter values include the initial wavelength, initial wave velocity, and initial fundamental amplitude. See also Figure 10 , Figure 10 The step 1041, which involves determining the initial waveform parameter values based on the physical drive, may include steps 10411 to 10413.
[0160] In step 10411, the driving intensity is mapped based on the first mapping relationship to obtain the initial wave velocity corresponding to the driving intensity.
[0161] The first mapping relationship represents the positive correlation between driving intensity and wave speed.
[0162] Here, the first mapping relationship can be a pre-defined mathematical function or lookup table, used to describe the change in wave velocity as the physical driving intensity increases. A positive correlation means that the two variables change in the same direction; that is, if one variable increases, the other also increases. The initial wave velocity is the baseline wave propagation speed determined solely by the current driving intensity before any random offset is superimposed.
[0163] In some embodiments, the current drive intensity value (such as a wind speed scalar) is read. A linear or exponentially growing function is invoked as the first mapping relationship, and the initial wave speed is calculated by inputting the drive intensity, simulating the physical phenomenon that the stronger the wind, the faster the wave propagates.
[0164] For example, with Figure 4 Taking the main stem and leaves of a plant as an example, suppose the wind force increases from a light breeze (level 1) to a strong wind (level 5). As the driving intensity increases, the initial wave speed increases significantly through the first mapping relationship, and the leaf fluttering frequency becomes higher.
[0165] In step 10412, the driving intensity is mapped based on the second mapping relationship to obtain the initial wavelength corresponding to the driving intensity.
[0166] The second mapping relationship characterizes the negative correlation between driving intensity and wavelength.
[0167] Here, the second mapping relationship can be a preset mathematical function or a lookup table, used to describe the rule that the wavelength decreases as the driving strength increases. The negative correlation refers to the opposite direction of change of two variables, that is, one variable increases and the other variable decreases. The initial wavelength is the length of the reference spatial waveform period determined by the current driving strength before the random offset is superimposed.
[0168] In some embodiments, an inverse proportional function or a piecewise linear decreasing function is called as the second mapping relationship to calculate the initial wavelength, simulating the waveform breaking and high-frequency details (shorter wavelength) caused by the turbulence generated under high wind speed.
[0169] For example, taking the main stem and leaves of the plant Figure 4 as an example, it is assumed that the wind force is increased from a breeze (level 1) to a strong wind (level 5). As the driving strength increases, the initial wavelength is shortened by the second mapping relationship, and more dense undulating textures are presented on the leaves.
[0170] In step 10413, the driving strength is mapped based on the third mapping relationship to obtain an initial basic amplitude corresponding to the driving strength.
[0171] Here, the third mapping relationship is used to represent a positive correlation between the driving strength and the amplitude.
[0172] Here, the third mapping relationship can be a preset mathematical function or a lookup table, used to describe the rule that the amplitude increases as the driving strength increases. The initial basic amplitude is the maximum wave swing amplitude of the reference before the random offset is superimposed.
[0173] In some embodiments, a positive proportional function or a saturated growth function (S-shaped curve) is called as the third mapping relationship to calculate the initial basic amplitude, simulating the swing amplitude increasing caused by the wind force increasing until reaching the physical limit.
[0174] For example, taking the main stem and leaves of the plant Figure 4 as an example, it is assumed that the wind force is increased from a breeze (level 1) to a strong wind (level 5). As the driving strength increases, the initial basic amplitude is increased by the third mapping relationship, and the swing range of the leaves is widened.
[0175] The embodiment of the application simulates the performance characteristics of fluid dynamics at different energy levels by constructing a mapping relationship (positive correlation or negative correlation) between the driving strength and the initial wave speed, the initial wavelength and the initial basic amplitude. The rapid and large movement under high-energy driving is reproduced by using the positive correlation characteristics of the first mapping relationship and the third mapping relationship; the phenomenon of increase in spatial frequency (i.e., the wavelength is shortened) caused by fluid instability in a strong flow field is successfully captured by using the negative correlation characteristics of the second mapping relationship. The control strategy based on the parameterized mapping not only avoids complex fluid physics calculation, but also gives animators intuitive control ability of physical effects (such as customizing the wind field response of "soft cloth" or "hard material" by adjusting the slope of the mapping curve), and realizes the balance between performance and expressiveness.
[0176] In step 1042, for each sub-joint in the joint chain, the distance between the first position corresponding to the sub-joint and the first position corresponding to the root joint is determined.
[0177] Here, the distance between the first position corresponding to the sub-joint and the first position corresponding to the root joint is a measure of the spatial position of the sub-joint after physical simulation relative to the position of the root joint, which is used to determine the phase position of the sub-joint on the wave propagation path.
[0178] In some embodiments, each sub-joint in the joint chain is traversed. For each sub-joint, the first position of the sub-joint and the first position of the root joint are read. The straight-line distance is calculated using the Euclidean distance formula, and the straight-line distance is taken as the distance between the first position corresponding to the sub-joint and the first position corresponding to the root joint.
[0179] For example, referring to Figure 5 for the middle joint 505 on the first joint chain of the skirt, the straight-line distance between it and the waist root joint 502 is calculated to be 0.4 meters.
[0180] In step 1043, a preset phase offset for the joint chain is obtained, and the current time, the phase offset, the shared waveform parameter value and the distance are periodically calculated to obtain the target amplitude of the sub-joint at the time.
[0181] Here, for each sub-joint, the sub-joint corresponds to a target amplitude at each time. The phase offset is a constant preset for adjusting the initial state of the waveform. The phase offset preset for each joint chain can be the same or different. Periodic calculation refers to the process of converting the linearly increasing time and spatial distance into reciprocating oscillation values using trigonometric functions (such as Sin function or Cos function).
[0182] In some embodiments, the periodic calculation of the current time, the phase offset, the shared waveform parameter value and the distance to obtain the target amplitude of the sub-joint at the time can be implemented by substituting the current time, the phase offset, the shared waveform parameter value and the distance into a trigonometric function to obtain the target amplitude of the sub-joint at the time.
[0183] The embodiments of the present application adopt the strategy of determining the initial waveform parameter based on the driving strength and superimposing random offset to obtain the shared waveform parameter value, which not only ensures that the wave dynamic of all joint chains can respond to environmental changes (such as strong wind and large waves), but also effectively breaks the mechanical synchronization feeling generated by multiple joint chains under the same driving through randomization processing, giving different joint chains personalized microscopic dynamic characteristics, and significantly improving the naturalness of group joint motion. The first position between the sub-joint and the root joint is used to calculate the real-time distance as a spatial variable for periodic calculation, ensuring that the generated wave is conducted along the actual physical form of the joint chain, rather than simple overall translation, thereby constructing a "traveling wave" effect consistent with physical intuition. The periodic calculation of the time, the phase offset, the shared waveform parameter value (including the wavelength and the wave speed) and the distance enables the joint chain of the virtual object to exhibit delicate, smooth and regular wave texture while maintaining macroscopic physical motion.
[0184] In some embodiments, the shared waveform parameter value includes a shared wavelength, a shared wave speed and a shared basic amplitude. Referring to Figure 11 , Figure 11 The periodic calculation of the current time, the phase offset, the shared waveform parameter value and the distance to obtain the target amplitude of the sub-joint at the time in step 1043 can include the following steps 10431 to 10432.
[0185] In step 10431, the time, the phase offset, the distance, the shared wavelength and the shared wave speed are operated by a sine function to obtain the vibration coefficient of the sub-joint.
[0186] Here, the shared wavelength is a spatial period parameter commonly used within a specific joint chain after random offset correction. The shared wave speed is a time propagation speed parameter commonly used within a specific joint chain after random offset correction. The shared basic amplitude is a maximum swing amplitude reference value commonly used within a specific joint chain after random offset correction. The vibration coefficient can be a dimensionless scalar that changes with time and space in the numerical interval [-1, 1] and represents the phase state of the wave.
[0187] In some embodiments, the vibration coefficient of the sub-joint is obtained by calculating the time, phase offset, distance, shared wavelength, and shared wave velocity using a sine function. This can be achieved as follows: the ratio of distance to shared wavelength is used as the spatial phase, the product of time and shared wave velocity is used as the temporal phase, the difference between the spatial phase and the temporal phase is calculated, and the sum of this difference and a preset phase offset is used as the total phase angle. The function value of the total phase angle is calculated by calling a standard sine function, and the output is the vibration coefficient.
[0188] For example, with Figure 5 In the skirt example, for sub-joint 505, the distance to root joint 502 is 0.4m. Assuming the current shared wavelength is 0.5m, the shared wave velocity is 1.8, the time is 2s, and the phase offset is 0, the total phase is calculated. Radius. Vibration coefficient .
[0189] In some embodiments, see Figure 12 , Figure 12 The step 10431 shows that the vibration coefficient of the sub-joint is obtained by calculating the time, phase offset, distance, shared wavelength and shared wave speed using a sine function, which may include steps 104311 to 104315.
[0190] In step 104311, a first ratio of distance to shared wavelength is determined, and the first ratio is weighted based on a preset spatial scaling factor to obtain the spatial phase component.
[0191] Here, the first ratio is the quotient obtained by dividing the distance between the sub-joint and the root joint by the shared wavelength, representing the number of wavelengths contained within that distance. The spatial scaling factor is a preset constant used to adjust the spatial frequency of the waveform, converting the number of wavelengths into radians. The spatial phase component refers to the phase part in the waveform formula that is related to the spatial position.
[0192] In some embodiments, the spatial phase component is obtained by weighting the first ratio based on a preset spatial scaling factor. This can be achieved by reading the preset spatial scaling factor (usually set to a value of 0.5) from a configuration file or memory. To ensure that the wavelength parameter corresponds to a complete sine cycle in physical terms, the spatial phase component is obtained by multiplying the preset spatial scaling factor and the first ratio.
[0193] For example, see Figure 5 If the distance between subjoint 503 and root joint 502 is 10cm, and the shared wavelength is set to 20cm, then the first ratio is 0.5. If the spatial scaling factor is... Then the spatial phase component is (i.e. half a period), indicating that the waveform has changed 180 degrees in phase from the root joint to this sub-joint.
[0194] In step 104312, the product of the time instant and the shared wave speed is determined, and the product is weighted based on a preset time scaling coefficient to obtain a time phase component.
[0195] Here, the product of the time instant and the shared wave speed refers to the multiplication result of the current time instant and the wave propagation speed, representing the effective distance of wave propagation in a given time. The time scaling coefficient refers to a constant for adjusting the phase change rate in the time dimension, controlling the fast or slow rhythm of wave motion. The time phase component refers to the phase part that linearly increases with time in the waveform formula.
[0196] In some embodiments, the product is weighted based on the preset time scaling coefficient to obtain the time phase component, which can be realized by the following way: recording the running time accumulated from the start of the animation , taking the running time t as the current time instant. Reading the preset time scaling coefficient (such as ), multiplying the preset time scaling coefficient and the product of the running time t and the shared wave speed to obtain the time phase component.
[0197] For example, if the time instant , the shared wave speed is 1.0, and the product is 1.0. If the time scaling coefficient is , then the time phase component is , meaning that the waveform advances one complete period per second.
[0198] In step 104313, the phase offset is weighted based on a preset offset scaling coefficient to obtain a weighted phase offset.
[0199] Here, the offset scaling coefficient refers to a parameter for adjusting the weight of the initial phase influence. The weighted phase offset refers to the initial angle constant that finally participates in the sine calculation.
[0200] In some embodiments, the phase offset is weighted based on the preset offset scaling coefficient to obtain the weighted phase offset, which can be realized by the following way: reading the phase offset assigned to the joint chain, multiplying the preset offset scaling coefficient and the phase offset to obtain the weighted phase offset.
[0201] For example, the phase offset assigned to a certain joint chain of the skirt is 0.5, and the offset scaling coefficient is set to 1.0, then the weighted phase offset is still 0.5 radian.
[0202] In step 104314, the difference between the spatial phase component and the time phase component is determined, and the difference is superimposed with the weighted phase offset to obtain the target phase angle.
[0203] Here, the target phase angle is the final angle sum before being substituted into the trigonometric function, which determines the specific state of the sine wave at the current time and current position (wave peak, wave trough, or zero point).
[0204] In some embodiments, the target phase angle is obtained by superimposing the difference value and the weighted phase offset. This can be achieved by directly adding the difference value and the weighted phase offset to obtain the target phase angle.
[0205] For example, assume that the spatial phase component is , the time phase component is , and the weighted phase offset is . The target phase angle is .
[0206] In step 104315, the sine value of the target phase angle is calculated by a sine function, and the sine value is determined as the vibration coefficient of the sub-joint.
[0207] Here, the vibration coefficient is the output value of the sine function, ranging between . The target phase angle is substituted into the sine function to calculate the vibration coefficient of the sub-joint.
[0208] For example, the sine function is calculated for the target phase angle , and the vibration coefficient is 0.95.
[0209] Embodiments of the present application introduce spatial scaling coefficients and time scaling coefficients to achieve independent normalization processing of spatial phase components (wavelength control) and time phase components (wave speed control), respectively, so that developers can use intuitive physical units (such as meters and seconds) to set shared wavelengths and shared wave speeds, without directly processing abstract radian values. Secondly, by calculating the difference between the spatial phase component and the time phase component, the propagation direction of the wave (i.e., the direction of the traveling wave) is clearly defined, ensuring that the wave naturally flows from the root joint to the sub-joint, rather than oscillating in the opposite direction or being stationary. Finally, the superposition of the weighted phase offset effectively introduces randomness or preset differences in the initial state, so that multiple joint chains (such as multiple leaves) calculated based on the same set of formulas can exhibit a "patchy" natural dynamic, avoiding mechanical synchronous swinging.
[0210] In step 10432, based on the vibration coefficient and the shared base amplitude, the target amplitude of the sub-joint at time t is determined.
[0211] In some embodiments, based on the vibration coefficient and the shared base amplitude, the target amplitude of the sub-joint at time t is determined. This can be achieved by multiplying the vibration coefficient and the shared base amplitude to obtain the target amplitude of the sub-joint at time t.
[0212] For example, assume a shared fundamental amplitude. Target amplitude That is, at the 2nd second, the position of the sub-joint should be shifted by about 1 cm in the opposite direction of the vibration.
[0213] This application's embodiments clearly decouple the "morphological changes" and "amplitude" of waves by calculating the vibration coefficient and target amplitude step by step. By comprehensively processing time (time dimension), distance (spatial dimension), phase shift, and shared wavelength / wave velocity using a sine function, the target amplitude is calculated efficiently. By combining the vibration coefficient with the shared base amplitude, the dimensionless wave signal is mapped to actual physical displacement, achieving precise quantitative control of wave intensity. This calculation paradigm not only has extremely low computational cost (requiring only simple trigonometric functions and algebraic operations) but also can simulate the unique "S"-shaped wave transmission effect of flexible objects in wind fields with remarkable realism.
[0214] In some embodiments, see Figure 13 , Figure 13 The step 10432, which determines the target amplitude of the sub-joint at a given time based on the vibration coefficient and the shared basic amplitude, may include steps 104321 to 104323.
[0215] In step 104321, the total length of the joint chain is obtained, and a second ratio of the distance between the sub-joint and the root joint to the total length is calculated. The second ratio is determined as the relative position of the sub-joint in the joint chain.
[0216] Here, the total length is the total path length of the joint chain from the root joint to the last sub-joint, or the straight-line distance between the first and last joint positions. The second ratio can refer to the normalized position of the sub-joint in the entire chain, and the value range is usually [0, 1], where 0 represents the root and 1 represents the end.
[0217] For example, with Figure 5 Taking a skirt as an example, the total length of the skirt is 0.8 meters. For a certain joint in the middle, its distance from the base is 0.4 meters. Then the relative position = 0.4 / 0.8 = 0.5, indicating that the joint is located in the middle of the skirt.
[0218] In step 104322, based on the relative position, the corresponding amplitude intensity coefficient is queried from the preset amplitude attenuation curve.
[0219] Among them, the amplitude decay curve is used to characterize the amplitude decay trend at different positions on the joint chain.
[0220] Here, the amplitude decay curve can be a pre-defined two-dimensional mapping relationship (such as...). The horizontal axis represents the relative position (0-1), and the vertical axis represents the amplitude intensity coefficient. This amplitude decay curve can be designed to increase monotonically to define the wave energy distribution. The amplitude intensity coefficient is a scalar value obtained from the amplitude decay curve, used to scale the wave amplitude. It is typically small at the root (or even 0) to keep it fixed, and large at the tail to represent swaying.
[0221] In some embodiments, an interpolation algorithm (Linear Interpolation) or a direct array lookup is used to read the corresponding amplitude intensity coefficient from the amplitude decay curve using the relative position as an index.
[0222] For example, when the horizontal axis (relative position) is 0.5, the corresponding value on the vertical axis is 0.6. This yields an amplitude intensity coefficient of 0.6. This means that the swing amplitude at the mid-section of the skirt is limited to 60% of its maximum value.
[0223] In step 104323, the product of the vibration coefficient, the shared base amplitude, and the amplitude intensity coefficient is determined as the target amplitude.
[0224] For example, the vibration coefficient is 0.95 (peak), the shared base amplitude is 5cm (strong wind), and the vibration intensity coefficient is 0.6 (mid-section). The target amplitude = 0.95 × 5 × 0.6 = 2.85cm. The final target amplitude of this sub-joint is 2.85 cm.
[0225] This application introduces an amplitude attenuation curve modulation mechanism based on relative position, significantly improving the physical realism and artistic controllability of procedural animation. By using the relative position calculated through total length normalization, the algorithm achieves scale invariance, enabling it to adapt to joint chains of varying lengths (such as hair of different lengths). The amplitude intensity coefficient is obtained by querying the amplitude attenuation curve, granting developers precise control over wave energy distribution. Finally, by multiplying the vibration coefficient, shared base amplitude, and amplitude intensity coefficient, a single formula successfully integrates the influence of the physical environment, procedural wave patterns, and skeletal structure constraints, achieving a delicate dynamic effect of "strong winds and large waves" and "stable roots and flexible branches."
[0226] In step 105, the position offset of the sub-joint is determined based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and the first position corresponding to the sub-joint is updated based on the position offset of the sub-joint to obtain the second position corresponding to the sub-joint.
[0227] Here, the position offset is a three-dimensional displacement vector obtained by multiplying the target amplitude (scalar) by the vibration direction (vector). The second position can be the final joint coordinates after superimposing this position offset, which is used to drive subsequent rendering or constraint correction.
[0228] In some embodiments, the first position corresponding to the subjoint is updated based on the position offset of the subjoint to obtain the second position corresponding to the subjoint. This can be achieved by directly superimposing the calculated position offset with the coordinates of the first position to obtain the second position corresponding to the subjoint.
[0229] This embodiment of the application obtains the joint chain of a virtual object and applies physical drive to the joint chain to simulate the first position of each joint. Then, it determines the vibration direction of the joint chain by combining a preset vibration direction angle. Based on this, it determines the target amplitude of the sub-joint based on the driving intensity of the physical drive, the first position of the sub-joint, and the first position of the root joint, and determines the position offset of the sub-joint based on the vibration direction. Finally, it updates the first position of the sub-joint to obtain the second position. This embodiment of the application, by further superimposing the position offset calculated based on the vibration direction, driving intensity, and positional relationship on the first position obtained by physical simulation, can retain the environmental interaction response brought by physical drive, and make the joint chain exhibit additional dynamic details by controlling the target amplitude and vibration direction. It can enrich the motion form of the joint chain and improve the expressiveness and flexibility of the virtual object in the simulation environment without increasing the complex physical calculation overhead.
[0230] In some embodiments, see Figure 14 , Figure 14 The joint position processing method provided in the embodiments of this application may further include the following steps 201 to 204.
[0231] In step 201, the root joints in multiple joint chains are fitted to obtain a reference closed curve.
[0232] Here, in the scenario where the virtual object is a skirt, fitting refers to the process of constructing a continuous and smooth geometric curve based on discrete joint positions using mathematical algorithms (such as least squares or spline interpolation). The reference closed curve is a simulated closed contour line surrounding the body parts of the virtual object (such as the waist or neck), used to help determine the geometric distribution characteristics of the joint chain.
[0233] In some embodiments, fitting the root joints of multiple joint chains to obtain a reference closed curve can be achieved by collecting the coordinates of the root joints of all joint chains in the simulation environment and calculating the center curve passing through the coordinates using a circle fitting or ellipse fitting algorithm, i.e., the reference closed curve.
[0234] For example, see Figure 5 The root joint 502 around the waist is fitted into a ring to obtain a reference closed curve.
[0235] In step 202, for each joint chain, a target position of the root joint of the joint chain on the reference closed curve is determined, and an outer normal direction corresponding to the target position is calculated.
[0236] Here, the outer normal direction is a vector direction perpendicular to the tangent of the reference closed curve and pointing to the outer region of the reference closed curve.
[0237] In some embodiments, the target position of each root joint on the reference closed curve is found, the tangent vector at the target position is calculated, and the tangent vector is rotated by 90 degrees to point to the outside to obtain the outer normal direction.
[0238] For example, referring to Figure 5 For a joint chain pointing straight ahead, the root joint is located at the front end of the ring, and the outer normal direction points straight ahead.
[0239] In step 203, a target plane composed of a first plane axis and a second plane axis is obtained from the coordinate system with the root joint as the origin, and a projection vector of the outer normal direction on the target plane is determined.
[0240] Here, the first plane axis and the second plane axis are perpendicular to the longitudinal axis of the coordinate system, and the longitudinal axis is in the direction of the root joint pointing to the first sub-joint in the joint chain.
[0241] Here, the projection vector is the component of the outer normal direction vector projected onto the target plane. The target plane is a two-dimensional plane formed by the two transverse axes (first and second plane axes) in the coordinate system of the root joint, which usually corresponds to the cross section of the root of the joint chain.
[0242] In some embodiments, the coordinate system data of the root joint is read, the X-axis and Y-axis perpendicular to the bone extension direction (longitudinal axis) are extracted to form the target plane, and the projection vector of the outer normal direction on the target plane is calculated using the vector projection formula.
[0243] In step 204, the included angle between the first plane axis and the projection vector in the target plane is determined as the preset vibration direction angle for the joint chain.
[0244] Here, the included angle can be the angle value required for the first plane axis to rotate to the projection vector in the target plane.
[0245] In some embodiments, the directed included angle or the minimum included angle between the projection vector and the first plane axis is calculated, and this included angle is saved as the vibration direction angle of the joint chain.
[0246] For example, referring to Figure 5The local cross-section (target plane) of the joint is obtained, and it is found that the normal to the front, after being projected onto the target plane, forms a 30-degree angle with the first plane axis (X-axis). This 30-degree angle is automatically recorded as the vibration direction angle of the joint chain. In subsequent animation calculations, the joint chain will vibrate along this 30-degree deflection direction (i.e., perpendicular to the skirt surface).
[0247] This application's embodiments automatically derive the geometric orientation of each joint chain within the overall structure by fitting a reference closed curve and calculating the direction of the external normal. Furthermore, by calculating the angle between its projection vector on the target plane and the first plane axis, intelligent preset of the vibration direction angle is achieved. This mechanism solves the problem that manually setting vibration angles is extremely tedious and difficult to guarantee normal consistency when dealing with a large number of densely arranged joint chains (such as skirts or hair). By automatically aligning the external normal, it ensures that the wave vibration direction of all joint chains uniformly points to the outer surface of the virtual object, effectively avoiding clipping phenomena caused by inward wave vibration (such as a skirt tucking into a leg), greatly improving the production efficiency of animation resources and the accuracy of visual performance during runtime.
[0248] In some embodiments, see Figure 15 , Figure 15 The joint position processing method provided in the embodiments of this application may further include the following steps 301 to 304.
[0249] In step 301, based on the constraint of the distance between joints, the second position corresponding to the sub-joint is corrected to obtain the third position corresponding to the sub-joint.
[0250] Here, the constraint on the distance between joints refers to the pre-defined rules for maintaining bone rigidity, requiring that the distance between child joints and parent joints remain constant or within an allowable elastic range after physical simulation (e.g., equal to the bone length at rest). Correction refers to using an algorithm to forcibly move coordinate points that do not meet the conditions to positions that do. The third position refers to the intermediate coordinate after length constraint correction, eliminating the overstretching problem.
[0251] In some embodiments, the second position corresponding to a sub-joint is corrected based on the constraint of the distance between joints to obtain the third position corresponding to the sub-joint. This can be achieved as follows: For each sub-joint, the distance between the second position of the sub-joint and the second position of its parent joint is calculated, and this distance is compared with a preset standard bone length included in the constraint. If the distance is greater than the standard bone length, the sub-joint is pulled back along the opposite direction until the distance equals the standard bone length, and the updated coordinates are used as the third position. If the distance is less than or equal to the standard bone length, the original second position is used as the third position.
[0252] In step 302, collision detection is performed on the third position corresponding to the sub-joint to obtain a detection result, and the third position corresponding to the sub-joint is corrected based on the detection result to obtain a fourth position corresponding to the sub-joint.
[0253] Here, the collision detection is a calculation process for judging whether the joint of the virtual object penetrates into the inside of other collision bodies (such as body skin or ground). The detection result can be a Boolean value indicating whether there is a collision. The fourth position is the final physically valid coordinate after the anti-penetration correction.
[0254] In some embodiments, a capsule detection or ray detection algorithm is used to determine whether the third position of the sub-joint is inside a preset collision body (such as a character leg collision body). If the detection result indicates that the third position of the sub-joint is inside the collision body, the third position corresponding to the sub-joint is pushed out along the surface normal direction of the collision body until it is no longer penetrated, and the updated position is taken as the fourth position. If the detection result indicates that the third position of the sub-joint is not inside the collision body, the original third position is taken as the fourth position.
[0255] In step 303, the joint position of the sub-joint in the animation of the virtual object is obtained, and a rotation angle for aligning the sub-joint from the joint position to the fourth position is determined.
[0256] Here, the joint position refers to a reference coordinate at the current time determined by the keyframe animation before the physical simulation and wave effect are superimposed. The rotation angle can be the angle required to rotate the sub-joint from the joint position to align with the fourth position.
[0257] In some embodiments, the joint positions of each joint in the joint chain of the virtual object output by the animation are read. For each sub-joint, a first vector is constructed based on the joint position of the parent joint of the sub-joint and the joint position of the sub-joint. A second vector is constructed based on the joint position of the parent joint of the sub-joint and the fourth position of the sub-joint, and the angle between the first vector and the second vector is calculated, which is the rotation angle.
[0258] In step 304, the position of the sub-joint in the animation is updated based on the fourth position corresponding to the sub-joint and the rotation angle.
[0259] Here, the animation frame update is completed by rotating the parent joint of the sub-joint by the rotation angle and assigning the fourth position corresponding to the sub-joint to the position of the sub-joint in the animation.
[0260] The embodiment of the present application corrects the constraint condition of the distance between the joints in sequence (obtains the third position) and the collision detection correction (obtains the fourth position), and combines the joint position to calculate the rotation angle, to construct a complete physical-animation post-processing closed loop. The bone stretching distortion problem caused by simple position superposition is solved, the stability of the rigid body structure is maintained, the visual penetration problem caused by wave motion is solved, the seamless data conversion from the particle physical system to the bone animation system is realized, and the final presented animation has both physical and wave dynamic beauty and strictly conforms to the geometric constraint and interaction logic.
[0261] In the following, an exemplary application of the embodiment of the present application in an actual application scenario will be described.
[0262] Games and animations often show the effect of objects swinging in the environmental wind field to enhance the picture expressiveness. For example, the swing of objects such as vegetation and grass under the action of wind force to enhance the environmental dynamics, the swing of the hair and clothes of the role under the action of wind force to enhance the animation details. The joint position processing method provided by the embodiment of the present application is a programmatic wave generation scheme in bone animation, which uses a set of role secondary animation tools based on joint simulation to support the generation of periodic wave forms of joint chains in the physical simulation process, to achieve a certain wind blowing effect and improve the detail expressiveness of the animation.
[0263] In the related art, the rotation animation scheme based on the pivot point driving of the vegetation "joint" is not a physical-based method nor a joint-based scheme, and is suitable for approximating the simulation of tree structures and the like. The scheme of grid (Mesh) level physical simulation combined with aerodynamics has physical reality and detail richness, but has a large amount of calculation and is not suitable for mobile terminal use. The scheme of directly correcting the position of the vertex has unnatural stretching problems due to generally ignoring the internal form constraint and deformation of the Mesh. The joint-based control scheme mainly achieves the animation purpose by controlling the rotation of the joint, and the disadvantage is that the control method is not intuitive, and after the target joint position is given, each joint local rotation amount must be obtained through a relatively complex algorithm.
[0264] The embodiment of the present application adopts a joint-driven animation scheme, directly corrects the joint position based on a sine function when the joint position is updated under the dynamic joint physical simulation framework based on spring particles, to realize periodic waveforms and further generate wave effects on the skin of the joint. Compared with the joint animation scheme in the related art, the embodiment of the present application directly controls the joint position to make it more convenient to achieve the control purpose, and the embodiment of the present application avoids the stretching of the joint and the penetration of the joint during the animation process through a complete physical simulation framework. Therefore, the embodiment of the present application provides a joint animation programmatic wave generation scheme with high performance, easy control, and physical reality.
[0265] The joint position processing method provided in the embodiments of the present application can be applied to an animation plug-in integrated in any engine software providing joint animation function. Figure 16 is a plug-in interface schematic diagram provided by the embodiments of the present application. Referring to Figure 16 , the engine software 1601 integrates an animation plug-in 1602, which can implement the joint position processing method provided in the embodiments of the present application. The core function of the animation plug-in is an animation node for controlling a joint chain, which is developed based on a UE joint control node base class. The animation node can process multiple joint chains at a time. Each joint chain can be simulated as an independent chain structure to simulate objects such as ribbons and hair, or all joint chains can be connected into a mesh structure to simulate objects such as cloth.
[0266] The animation plug-in of the embodiments of the present application can be provided to users as a function of the wind module of the animation node. Figure 17 is an editor interface schematic diagram provided by the embodiments of the present application. Referring to Figure 17 , the editor interface 1701 displays an example of simulating hair by the animation node. The joint simulation diagram of the hair is displayed on the left animation effect interface 1704. The configuration bar 1703 of the wind function is provided in the detail panel 1702 of the animation node on the right, and the user can check the sine wave option through the configuration bar 1703 to generate a programmed wave effect in the process of simulating the hair. The parameters in the configuration bar 1703 are configuration parameters for wave generation.
[0267] The embodiments of the present application are directed to joint animation, and based on the dynamic joint physical simulation framework of the spring particle, the joint position is directly corrected based on the sine function when the joint position is updated, so as to realize periodic joint waveforms and further generate wave effects on the skin of the joint. The core carrier of the skin is the mesh (a polygonal geometry composed of a large number of vertices and faces), and the vertices are assigned weight information and establish a binding relationship with one or more joints in the joint chain. For example, the skin of the ribbon is an elongated mesh patch, and the vertices are bound to the corresponding joint chain of the ribbon in proportion; the skin of the hair is a small cylindrical mesh, which is bound to the joint of a single hair.
[0268] Figure 18 is a joint simulation animation flowchart provided by the embodiments of the present application. Referring to Figure 18 , in step 1801, the joint simulation position is updated based on external force and speed.
[0269] Here, for each joint, the position of the joint at the previous time is updated based on the external force received by the joint at the previous time and the speed of the joint at the previous time, to obtain the position of the joint at the current time (corresponding to the first position in the above embodiment).
[0270] In step 1802, the joint simulation position is adjusted based on a sine function.
[0271] Here, the motion state of the joint is superimposed with multiple different sine waveforms through the sine function, to generate a more complex waveform effect. Figure 19 is a flowchart of joint waveform generation provided by the embodiments of the present application.
[0272] Referring to Figure 19 In step 1901, a joint chain set to which a sine waveform needs to be superimposed is determined.
[0273] Here, the joint chain set to which the sine waveform needs to be superimposed is set on a parameter configuration panel of the animation node. Figure 20 is a schematic diagram of a parameter configuration panel provided by the embodiments of the present application. Referring to Figure 20 In the Joint Pairs 2001, any number of elements (one index corresponds to one element) are added, each element corresponds to a joint chain (at least including two joints), and each element includes 2 members: a root joint and an end bone. The user can need to input the name of the root joint and the name of the end bone. If the name of the end bone is None, the last joint on the joint chain is the end bone by default. Index [0] corresponds to joint chain 0, including root joint (Root Bone) A and end bone (End Bone) D.
[0274] In step 1902, the waveform parameters of each joint chain are initialized.
[0275] Here, Figure 21 is a schematic diagram of a waveform parameter list provided by the embodiments of the present application. Referring to Figure 21 The waveform parameters include a vibration direction angle, an amplitude, a wavelength, a wave speed, and a phase offset. Among them, the vibration direction angle and the phase offset are set separately for each joint chain, and the specific setting method can be set according to rules or randomly. For the amplitude, the wavelength, and the wave speed, a set of common parameters are first set for all joint chains, and then each joint chain randomly offsets within a certain interval on the three common parameters, so that the three parameters of all joint chains have both overall consistency and some subtle differences.
[0276] In step 1903, the position offset of the joint on the joint chain is calculated based on time and a sine function.
[0277] Here, the position offset (vector) of each joint is obtained by multiplying the vibration direction (vector) of the joint chain and the vibration amplitude (numerical value) of each joint. The vibration direction is the direction of the joint position offset, and the joints on each joint chain will adjust the position in the same direction. This direction is updated based on the following process every frame during runtime:
[0278] First, the three axes of the coordinate system with the root joint as the origin, X_Bone, Y_Bone and Z_Bone, are obtained. And assume that Z_Bone is along the direction of the axis of the root joint. Figure 22 is a schematic diagram of the coordinate system with the root joint as the origin provided by the embodiments of the present application. Referring to Figure 22 The coordinate system with the root joint 2201 as the origin includes three axes: X_Bone (corresponding to the first plane axis in the above embodiment), Y_Bone (corresponding to the second plane axis in the above embodiment) and Z_Bone (corresponding to the longitudinal axis in the above embodiment), wherein the direction of Z_Bone is the direction of the root joint 2201 pointing to the first root joint 2202, and X_Bone and Y_Bone are perpendicular to Z_Bone, respectively.
[0279] Then, the main direction Z_Chain of the joint chain is defined. The main direction Z_Chain can be the direction from the root joint of the joint chain to a certain sub-joint, such as the direction to the next joint, such as the direction to the end joint position. It can also be the average direction of the directions from the root joint to some sub-joints.
[0280] Then, the secondary direction X_Chain (corresponding to the first secondary direction in the above embodiment) and Y_Chain (corresponding to the second secondary direction in the above embodiment) of the joint chain are defined, and the secondary direction X_Chain and Y_Chain are the projection directions of X_Bone and Y_Bone to the plane perpendicular to Z_Chain, respectively. The direction of X_Chain rotating a preset angle with Y_Chain is selected as the direction of the wave swing of the joint chain, wherein the preset angle is the vibration direction angle parameter of the joint chain.
[0281] The calculation formula of the amplitude of each joint on the joint chain is: joint amplitude = Sin (c1 x joint length to the root joint of the joint chain / wavelength - c2 x time x wave speed + c3 x phase offset) x amplitude. Wherein, c1, c2 and c3 (the same value is used for each joint chain) are scale coefficients of corresponding parameters (corresponding to the space scaling coefficient, time scaling coefficient and offset scaling coefficient in the above embodiment), which are set in advance during calculation.
[0282] In practical applications, users can also set an amplitude decay curve to adjust the waveform of the joint chain so that the fluctuation amplitude is small near the root and large near the tail. For this purpose, parameters such as... can be added to the waveform parameters of the joint chain. Figure 23 The amplitude intensity curve is shown. For each joint, the ratio of the distance from that joint to the root joint to the length of the entire joint chain (corresponding to the second ratio in the above embodiment) is obtained. The amplitude intensity coefficient on the vertical axis is read from the amplitude intensity curve with the ratio as the horizontal axis coordinate. Multiplying this amplitude intensity coefficient by the joint amplitude yields the final amplitude of that joint. Joint amplitude = Sin(c1 × length from joint to root joint of joint chain / wavelength – c2 × time × wave velocity + c3 × phase shift) × amplitude × amplitude intensity coefficient.
[0283] The following section describes the mapping relationship between local wave effects and the global wind field.
[0284] The wave effect generated by the above scheme is based on pre-set wake-up parameters and is not directly related to the wind field in the environment. The overall impact of the ambient wind on the joint chain is reflected in step 1801. The wave generated in this embodiment is a superposition of wave details after step 1801. The oscillation direction of the wave is not directly affected by the ambient wind field, but the wave intensity can be positively correlated with the magnitude of the ambient wind force. One way to achieve this function is to first define the effective range of the ambient wind field intensity input value (corresponding to the driving intensity in the above embodiment), as well as the effective range of amplitude, wavelength, and wave speed in the waveform parameters, and then define the linear or nonlinear mapping relationship from the ambient wind field intensity range to the three waveform parameter ranges: wind field intensity range -> amplitude range (positively proportional), wind field intensity range -> wavelength range (inversely proportional), wind field intensity range -> wave speed range (positively proportional). This means that the faster the wind speed, the larger the wave amplitude, the higher the spatial frequency (the shorter the wavelength), and the faster the wave speed. Then, based on this mapping relationship and the magnitude of the ambient wind field, the values of the three common waveform parameters can be updated in real time, while the other waveform parameters of the joint chain are still set in advance in the same way as before.
[0285] Step 1904: Apply the position offset to the joint position.
[0286] Here, the simulated joint position of each joint is updated based on the calculated position offset of each joint.
[0287] Step 1803: Adjust the simulated joint position based on inter-joint constraints.
[0288] Here, based on the constraints of the inter-joint distance and angle, the simulated joint position obtained in step 1802 (corresponding to the second position in the above embodiment) is adjusted to ensure that the joint length does not undergo significant stretching.
[0289] Step 1804: Correct the simulated joint position based on collision detection.
[0290] Here, collision detection is performed on the simulated joint positions of the multiple joints obtained in step 1803 (corresponding to the third position in the above embodiment). The detection results are then used to correct the positions of the multiple joints to ensure that basic clipping does not occur after the joint positions are adjusted.
[0291] Step 1805: Update the joint simulation rotation based on the joint simulation position and the joint animation position.
[0292] Here, based on the joint simulation position obtained in step 1804 (corresponding to the fourth position in the above embodiment) and the joint animation position in the animation (corresponding to the joint position in the above embodiment), the joint simulation rotation (corresponding to the rotation angle in the above embodiment) is calculated. The joint simulation rotation may include rotation parameters used to control the orientation of the joint, representing the sum of all three-dimensional rotation operations actually performed by its parent joint, causing the joint to move from the joint animation position to the joint simulation position.
[0293] Step 1806: Update the animated position and rotation of the joints based on the simulated joint position and simulated rotation.
[0294] Here, based on the simulated joint position and simulated rotation obtained in step 1805, the animated position and rotation of the joint are actually updated in the animation.
[0295] The simulation process in this embodiment uses the principle of position-based dynamics, which allows us to directly correct the joint position in step 1802.
[0296] Figure 24 This is a schematic diagram of hair wave animation provided in an embodiment of this application. See also... Figure 24 , Figure 24 medium hair compared to Figure 17 The hair without a sinusoidal waveform clearly has a more dynamic visual effect. See also Figure 5 In the embodiment of skirt wave generation, the waveform vibration direction angle of each joint chain is set as follows: First, it can be seen that the root joint of each joint chain is at the waist, and all the root joint positions form a circle, corresponding to the waistline position of the character. For each root joint, the outer normal direction (n) of the circle is obtained, and the outer normal direction is projected onto the plane where the X and Y axes of the root joint are located. Assuming that the X axis is rotated by an angle α in the Y axis direction and coincides with the projected outer normal direction, the vibration direction angle of this joint chain is set to tα. Figure 25is a schematic diagram of a vibration direction angle provided by an embodiment of the present application. This setting mode makes the joint chain swing along the normal direction of the body in the simulation process, forming a more beautiful wave effect.
[0297] Figure 26 is an effect diagram of waves under different environmental wind forces provided by an embodiment of the present application. Referring to Figure 26 , the first diagram is the wave effect when the wind force (WindForce) = 10, the second diagram is the wave effect when the wind force = 50, and the third diagram is the wave effect when the wind force = 100. It can be seen that when the environmental wind force increases, the wave effect also becomes more intense.
[0298] The following continues to describe an exemplary structure of the implementation of the joint position processing apparatus 455 provided by an embodiment of the present application as a software module. In some embodiments, as shown in Figure 2 , the software module stored in the joint position processing apparatus 455 of the memory 450 can include:
[0299] The obtaining module 4551 is configured to obtain a plurality of joint chains of a virtual object, wherein each joint chain includes a root joint and at least one sub-joint.
[0300] The simulation module 4552 is configured to, for each joint in each joint chain, simulate a first position of the joint based on an acting force of a physical drive in a simulation environment applied to the joint, wherein the first position is the position of the joint in the simulation environment.
[0301] The first determination module 4553 is configured to, for each joint chain, determine a vibration direction of the joint chain based on a preset vibration direction angle of the joint chain.
[0302] The second determination module 4554 is configured to, for each sub-joint in the joint chain, determine a target amplitude of the sub-joint based on a driving strength of the physical drive, the first position of the sub-joint, and the first position of the root joint in the joint chain.
[0303] The position updating module 4555 is configured to determine a position offset of the sub-joint based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and update the first position of the sub-joint based on the position offset of the sub-joint to obtain a second position of the sub-joint.
[0304] In some embodiments, the first determination module 4553 is further configured to, for each joint chain, determine a coordinate system with the root joint in the joint chain as the origin, wherein an axial direction of a longitudinal axis of the coordinate system is a direction in which the root joint points to a first sub-joint in the joint chain; determine a main orientation of the joint chain based on the first position of the root joint and the first positions of at least one sub-joint in the joint chain; and determine the vibration direction of the joint chain based on the main orientation, the coordinate system, and the vibration direction angle.
[0305] In some embodiments, the first determining module 4553 is further configured to perform at least one of the following processes: determining a first direction from the first position corresponding to the root joint to the first position corresponding to the first sub-joint as the main orientation; determining a second direction from the first position corresponding to the root joint to the first position corresponding to the last sub-joint of the joint chain as the main orientation; determining a third direction from the first position corresponding to the root joint to the first position corresponding to each sub-joint of the joint chain, and determining an average of the plurality of third directions as the main orientation.
[0306] In some embodiments, the first determining module 4553 is further configured to obtain a first plane axis and a second plane axis of the coordinate system, where the first plane axis and the second plane axis are perpendicular to the longitudinal axis; determine a projection plane perpendicular to the main orientation, and determine a projection direction of the first plane axis on the projection plane as a first secondary orientation of the joint chain, and determine a projection direction of the second plane axis on the projection plane as a second secondary orientation of the joint chain; rotate the first secondary orientation to the second secondary orientation according to the vibration direction angle on the projection plane, and determine the rotated first secondary orientation as the vibration direction of the joint chain.
[0307] In some embodiments, the second determining module 4554 is further configured to determine an initial waveform parameter value based on the driving strength of the physical drive, and randomly offset the initial waveform parameter value to obtain a shared waveform parameter value of the joint in the joint chain; determine a distance between the first position corresponding to the sub-joint and the first position corresponding to the root joint for each sub-joint in the joint chain; obtain a preset phase offset for the joint chain, and periodically calculate the current time, the phase offset, the shared waveform parameter value, and the distance to obtain a target amplitude of the sub-joint at the time.
[0308] In some embodiments, the initial waveform parameter value includes an initial wavelength, an initial wave speed, and an initial basic amplitude; the second determining module 4554 is further configured to map the driving strength based on a first mapping relationship to obtain an initial wave speed corresponding to the driving strength, where the first mapping relationship represents a positive correlation between the driving strength and the wave speed; map the driving strength based on a second mapping relationship to obtain an initial wavelength corresponding to the driving strength, where the second mapping relationship represents a negative correlation between the driving strength and the wavelength; and map the driving strength based on a third mapping relationship to obtain an initial basic amplitude corresponding to the driving strength, where the third mapping relationship represents a positive correlation between the driving strength and the amplitude.
[0309] In some embodiments, the shared waveform parameter value comprises a shared wavelength, a shared wave speed, and a shared base amplitude; the second determining module 4554 is further configured to obtain a vibration coefficient of the sub-joint by performing a sine function operation on the time point, the phase offset, the distance, the shared wavelength, and the shared wave speed; and determine a target amplitude of the sub-joint at the time point based on the vibration coefficient and the shared base amplitude.
[0310] In some embodiments, the second determining module 4554 is further configured to determine a first ratio of the distance to the shared wavelength, and weight the first ratio based on a preset spatial scaling coefficient to obtain a spatial phase component; determine a product of the time point and the shared wave speed, and weight the product based on a preset time scaling coefficient to obtain a time phase component; weight the phase offset based on a preset offset scaling coefficient to obtain a weighted phase offset; determine a difference between the spatial phase component and the time phase component, and superimpose the difference and the weighted phase offset to obtain a target phase angle; calculate a sine value of the target phase angle by a sine function, and determine the sine value as the vibration coefficient of the sub-joint.
[0311] In some embodiments, the second determining module 4554 is further configured to obtain a total length of the joint chain, and calculate a second ratio of the distance between the sub-joint and the root joint to the total length, and determine the second ratio as a relative position of the sub-joint in the joint chain; based on the relative position, query a corresponding amplitude intensity coefficient from a preset amplitude attenuation curve, wherein the amplitude attenuation curve is used to represent an amplitude attenuation trend at different positions in the joint chain; and determine a product of the vibration coefficient, the shared base amplitude, and the amplitude intensity coefficient as the target amplitude.
[0312] In some embodiments, the joint position processing apparatus 455 further comprises an angle determining module configured to fit the root joint in the plurality of joint chains to obtain a reference closed curve; for each joint chain, determine a target position of the root joint of the joint chain on the reference closed curve, and calculate an external normal direction corresponding to the target position; obtain a target plane composed of a first plane axis and a second plane axis from a coordinate system with the root joint as an origin, and determine a projection vector of the external normal direction on the target plane, wherein the first plane axis and the second plane axis are respectively perpendicular to a longitudinal axis of the coordinate system, and an axial direction of the longitudinal axis is a direction in which the root joint points to a first sub-joint in the joint chain; and determine an included angle between the first plane axis in the target plane and the projection vector as a preset vibration direction angle for the joint chain.
[0313] In some embodiments, the obtaining module 4551 is further configured to receive configuration data for the joint chain of the virtual object, where the configuration data includes a plurality of sets of joint pair information, each set of joint pair information including a start joint identifier and an end joint identifier; for each set of joint pair information, determining a joint corresponding to the start joint identifier in the joint pair information as a root joint, and determining a joint corresponding to the end joint identifier in the joint pair information as a last child joint in the joint chain; and constructing a joint chain corresponding to the joint pair information based on a hierarchical connection relationship between the root joint and the last child joint.
[0314] In some embodiments, the joint position processing apparatus 455 further includes an animation updating module configured to correct the second position of the child joint based on the constraint condition on the distance between the joints to obtain a third position of the child joint; perform collision detection on the third position of the child joint to obtain a detection result, and correct the third position of the child joint based on the detection result to obtain a fourth position of the child joint; obtain a joint position of the child joint in an animation of the virtual object, and determine a rotation angle for aligning the child joint from the joint position to the fourth position; and update the position of the child joint in the animation based on the fourth position of the child joint and the rotation angle.
[0315] The embodiments of the present application provide a computer program product, which includes a computer program or computer executable instructions. A processor of an electronic device executes the computer program or computer executable instructions, so that the electronic device executes the joint position processing method provided by the embodiments of the present application.
[0316] The embodiments of the present application provide a computer readable storage medium, which stores computer executable instructions or a computer program. When the computer executable instructions or the computer program are executed by a processor, the processor will execute the joint position processing method provided by the embodiments of the present application, for example, the joint position processing method shown in the above. Figure 3
[0317] In some embodiments, the computer readable storage medium can be a RAM, a ROM, a flash memory, a magnetic surface memory, an optical disc, or a CD-ROM, etc. storage medium; or can be various devices including one or any combination of the above storage medium.
[0318] In some embodiments, the computer executable instructions can be in the form of a program, software, software module, script or code, written in any form of programming language (including a compiled or interpreted language, or a declarative or procedural language), and can be deployed in any form, including being deployed as a standalone program or being deployed as a module, component, subroutine or other unit suitable for use in a computing environment.
[0319] By way of example, computer-executable instructions can include but are not limited to: a procedure, a function, a subprogram, a program, a routine, a subroutine, a component, a data structure, an application, or the like. A computer-executable instruction can or can not correspond to a file in a file system. A procedure can be a self-consistent sequence of instructions implemented using any combination of the computer-executable instructions made using an organized list, a flowchart, or any other computer program design / implementation tool.
[0320] By way of example, the computer-executable instructions can be deployed to be executed by one electronic device, or by multiple electronic devices that are located at one site, or by multiple electronic devices that are distributed among multiple sites and that are interconnected through a communication network.
[0321] To sum up, the embodiment of the present application aims at joint animation, and directly corrects joint position based on a sine function when updating joint position under a dynamic joint physical simulation framework based on a spring particle, so as to realize periodic waveforms of the joint, and further drive the hair and clothes of the character to produce a wave effect similar to that under the action of wind force.
[0322] The above merely provides an example of the embodiment of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, and improvement within the spirit and scope of the present application shall be included in the protection scope of the present application.
Claims
1. A method for processing the position of a joint, characterized in that, The method includes: Obtain multiple joint chains of a virtual object, wherein each joint chain includes a root joint and at least one child joint; For each joint in each of the joint chains, a first position corresponding to the joint is simulated based on the force applied to the joint by the physical drive in the simulation environment, wherein the first position is the position of the joint in the simulation environment; For each of the joint chains, the vibration direction of the joint chain is determined based on a preset vibration direction angle for the joint chain; For each sub-joint in the joint chain, the target amplitude of the sub-joint is determined based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain. Based on the target amplitude of the sub-joint and the vibration direction of the joint chain, the position offset of the sub-joint is determined, and based on the position offset of the sub-joint, the first position corresponding to the sub-joint is updated to obtain the second position corresponding to the sub-joint.
2. The method according to claim 1, characterized in that, The step of determining the vibration direction of each joint chain based on a preset vibration direction angle for that joint chain includes: For each of the joint chains, a coordinate system is determined with the root joint of the joint chain as the origin, wherein the axial direction of the vertical axis of the coordinate system is the direction from the root joint to the first sub-joint in the joint chain; Based on the first position corresponding to the root joint and the first position corresponding to at least one of the sub-joints in the joint chain, the main orientation of the joint chain is determined. The vibration direction of the joint chain is determined based on the main orientation, the coordinate system, and the vibration direction angle.
3. The method according to claim 2, characterized in that, Determining the main orientation of the joint chain based on the first position corresponding to the root joint and the first position corresponding to at least one of the sub-joints in the joint chain includes: Perform at least one of the following processes: The first direction from the first position corresponding to the root joint to the first position corresponding to the first sub-joint is determined as the main orientation. The second direction, pointing from the first position corresponding to the root joint to the first position corresponding to the last sub-joint of the joint chain, is determined as the main orientation; A third direction is determined from the first position corresponding to the root joint to the corresponding first position of each of the sub-joints in the joint chain, and the average of the multiple third directions is determined as the main direction.
4. The method according to claim 2, characterized in that, Determining the vibration direction of the joint chain based on the principal orientation, the coordinate system, and the vibration direction angle includes: Obtain the first and second planar axes of the coordinate system, wherein the first and second planar axes are perpendicular to the vertical axis; A projection plane perpendicular to the primary orientation is determined, and the projection direction of the first plane axis on the projection plane is determined as the first secondary orientation of the joint chain, and the projection direction of the second plane axis on the projection plane is determined as the second secondary orientation of the joint chain; On the projection plane, the first secondary orientation is rotated toward the second secondary orientation according to the vibration direction angle, and the rotated first secondary orientation is determined as the vibration direction of the joint chain.
5. The method according to claim 1, characterized in that, The determination of the target amplitude of each sub-joint in the joint chain, based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain, includes: Based on the driving intensity of the physical drive, the initial waveform parameter values are determined, and the initial waveform parameter values are randomly offset to obtain the shared waveform parameter values of the joints in the joint chain. For each sub-joint in the joint chain, determine the distance between the first position corresponding to the sub-joint and the first position corresponding to the root joint; Obtain the preset phase offset for the joint chain, and periodically calculate the current time, the phase offset, the shared waveform parameter value, and the distance to obtain the target amplitude of the sub-joint at the time.
6. The method according to claim 5, characterized in that, The initial waveform parameter values include the initial wavelength, initial wave velocity, and initial fundamental amplitude; The determination of initial waveform parameter values based on the driving intensity of the physical drive includes: Based on the first mapping relationship, the driving intensity is mapped to obtain the initial wave velocity corresponding to the driving intensity, wherein the first mapping relationship characterizes the positive correlation between the driving intensity and the wave velocity; Based on the second mapping relationship, the driving intensity is mapped to obtain the initial wavelength corresponding to the driving intensity, wherein the second mapping relationship characterizes the negative correlation between the driving intensity and the wavelength; Based on the third mapping relationship, the driving intensity is mapped to obtain the initial basic amplitude corresponding to the driving intensity, wherein the third mapping relationship is used to characterize the positive correlation between the driving intensity and the amplitude.
7. The method according to claim 5, characterized in that, The shared waveform parameter values include shared wavelength, shared wave velocity, and shared fundamental amplitude; The step of periodically calculating the target amplitude of the sub-joint at the current time, the phase offset, the shared waveform parameter value, and the distance to obtain the target amplitude of the sub-joint at that time includes: The vibration coefficient of the sub-joint is obtained by calculating the time, phase shift, distance, shared wavelength, and shared wave velocity using a sine function. Based on the vibration coefficient and the shared basic amplitude, the target amplitude of the sub-joint at that time is determined.
8. The method according to claim 7, characterized in that, The process of calculating the vibration coefficient of the sub-joint using a sine function on the time, phase shift, distance, shared wavelength, and shared wave velocity includes: A first ratio of the distance to the shared wavelength is determined, and the first ratio is weighted based on a preset spatial scaling factor to obtain the spatial phase component; Determine the product of the time and the shared wave velocity, and weight the product based on a preset time scaling factor to obtain the time phase component; The phase offset is weighted based on a preset offset scaling factor to obtain the weighted phase offset; The difference between the spatial phase component and the temporal phase component is determined, and the difference is superimposed with the weighted phase offset to obtain the target phase angle; The sine value of the target phase angle is calculated using the sine function, and the sine value is determined as the vibration coefficient of the sub-joint.
9. The method according to claim 7, characterized in that, Determining the target amplitude of the sub-joint at the given time based on the vibration coefficient and the shared basic amplitude includes: Obtain the total length of the joint chain, and calculate a second ratio of the distance between the sub-joint and the root joint to the total length, and determine the second ratio as the relative position of the sub-joint in the joint chain; Based on the relative position, the corresponding amplitude intensity coefficient is queried from the preset amplitude decay curve, wherein the amplitude decay curve is used to characterize the amplitude decay trend at different positions on the joint chain; The product of the vibration coefficient, the shared base amplitude, and the amplitude intensity coefficient is determined as the target amplitude.
10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: A reference closed curve is obtained by fitting the root joint of the plurality of joint chains; For each joint chain, determine the target position of the root joint of the joint chain on the reference closed curve, and calculate the outward normal direction corresponding to the target position; From the coordinate system with the root joint as the origin, obtain the target plane formed by the first plane axis and the second plane axis, and determine the projection vector of the external normal direction on the target plane, wherein the first plane axis and the second plane axis are perpendicular to the vertical axis of the coordinate system, and the axis of the vertical axis is the direction from the root joint to the first sub-joint in the joint chain; The angle between the first plane axis in the target plane and the projection vector is determined as the preset vibration direction angle for the joint chain.
11. The method according to any one of claims 1 to 9, characterized in that, The acquisition of multiple joint chains of the virtual object includes: Receive configuration data for the joint chain of the virtual object, wherein the configuration data includes multiple sets of joint pair information, and each set of joint pair information includes a start joint identifier and an end joint identifier; For each set of joint pair information, the joint corresponding to the starting joint identifier in the joint pair information is determined as the root joint, and the joint corresponding to the ending joint identifier is determined as the last child joint in the joint chain. Based on the hierarchical connection relationship between the root joint and the last sub-joint, the joint chain corresponding to the joint pair information is constructed.
12. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Based on the constraint of the distance between the joints, the second position corresponding to the sub-joint is corrected to obtain the third position corresponding to the sub-joint; Collision detection is performed on the third position corresponding to the sub-joint to obtain the detection result, and the third position corresponding to the sub-joint is corrected based on the detection result to obtain the fourth position corresponding to the sub-joint. Obtain the joint position of the sub-joint in the animation of the virtual object, and determine the rotation angle for aligning the sub-joint from the joint position to the fourth position; The position of the sub-joint in the animation is updated based on the fourth position corresponding to the sub-joint and the rotation angle.
13. A joint position processing device, characterized in that, The device includes: An acquisition module is used to acquire multiple joint chains of a virtual object, wherein each joint chain includes a root joint and at least one sub-joint; The simulation module is used to simulate a first position corresponding to each joint in each of the joint chains, based on the force applied to the joint by a physical drive in the simulation environment, wherein the first position is the position of the joint in the simulation environment; The first determining module is used to determine the vibration direction of each joint chain based on a preset vibration direction angle for the joint chain. The second determining module is used to determine the target amplitude of each sub-joint in the joint chain based on the driving intensity of the physical drive, the first position corresponding to the sub-joint, and the first position corresponding to the root joint in the joint chain. The position update module is used to determine the position offset of the sub-joint based on the target amplitude of the sub-joint and the vibration direction of the joint chain, and update the first position corresponding to the sub-joint based on the position offset of the sub-joint to obtain the second position corresponding to the sub-joint.
14. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the joint position processing method according to any one of claims 1 to 12.
15. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the joint position processing method according to any one of claims 1 to 12 is implemented.
16. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the joint position processing method according to any one of claims 1 to 12 is implemented.
Citation Information
Patent Citations
Action difference degree calculation method and device, equipment and storage medium
CN112562071A
KR20250110116A