CN110570357A - mirror image implementation method, device, equipment and storage medium based on UE4 engine - Google Patents

mirror image implementation method, device, equipment and storage medium based on UE4 engine Download PDF

Info

Publication number
CN110570357A
CN110570357A CN201910612942.8A CN201910612942A CN110570357A CN 110570357 A CN110570357 A CN 110570357A CN 201910612942 A CN201910612942 A CN 201910612942A CN 110570357 A CN110570357 A CN 110570357A
Authority
CN
China
Prior art keywords
mirror image
role
model
mirror
root node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910612942.8A
Other languages
Chinese (zh)
Inventor
罗威
许秋子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruili Visual Multimedia Technology Co Ltd
Shenzhen Realis Multimedia Technology Co Ltd
Original Assignee
Shenzhen Ruili Visual Multimedia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruili Visual Multimedia Technology Co Ltd filed Critical Shenzhen Ruili Visual Multimedia Technology Co Ltd
Priority to CN201910612942.8A priority Critical patent/CN110570357A/en
Publication of CN110570357A publication Critical patent/CN110570357A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Abstract

The invention discloses a mirror image implementation method based on a UE4 engine, which comprises the following steps: creating a mirror role and setting the position and rotation information of a main root node component; setting the position and rotation information of the mirror image role secondary root node component by referring to the position and rotation information of the original role; calculating a displacement vector and a rotation value of a mirror image skeleton model of the mirror image role based on the position and rotation information of the mirror image role secondary root node component; setting the reverse kinematic posture of the mirror image bone model, and carrying out bone space transformation on the mirror image bone model to obtain the mirror image posture of the mirror image bone model; and carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain and output a mirror image action corresponding to the mirror image bone model. The invention also discloses a mirror image implementation device, equipment and a storage medium based on the UE4 engine. The invention improves the flexibility and changeability of the mirror surface effect of the virtual character.

Description

Mirror image implementation method, device, equipment and storage medium based on UE4 engine
Technical Field
the invention relates to the technical field of virtual reality, in particular to a mirror image implementation method, device, equipment and storage medium based on a UE4 engine.
background
the UE4 engine (i.e. the illusion engine 4) may use a Scene Capture 2D Actor (Scene Capture 2D object) to implement display of real-time mirror images, the principle of the object is that the object has a camera function, the object can transfer a picture taken by the camera to a texture map, create a Render Target texture map, then make the texture map an output Target texture map of the Scene Capture 2D Actor, then create a material according to the texture map, create a Cube Actor (rectangular parallelepiped) on the Scene, and implement the mirror effect by applying the material, which is that the main role of the player can see the mirror images of the player by acting in front of the mirror surface.
in the prior art, the mirror image is realized by a method of taking a picture by a camera in a phantom engine 4 and carrying out mirror image processing on the picture rendered by the camera, but the mirror image effect is not particularly flexible in such a way, for example, the effect of changing clothes, if the rendered picture is directly subjected to mirror image processing and displayed, the model background of the main role of the user is the same as that of the mirror image, and the effect similar to a magic mirror cannot be realized.
disclosure of Invention
The invention mainly aims to provide a mirror image implementation method based on a UE4 engine, related equipment and a storage medium, and aims to solve the technical problem that the mirror effect achieved based on the UE4 engine is poor.
In order to achieve the above object, the present invention provides a mirror image implementation method based on a UE4 engine, where the mirror image implementation method based on a UE4 engine includes the following steps:
creating a mirror role and setting the position and rotation information of a main root node component, wherein the mirror role comprises the following steps: a primary root node component, a secondary root node component and a mirror image skeleton model;
the mirror image role primary root node assembly is used as a reference standard, the position and rotation information of the original role are converted, and the converted position and rotation information are set as the position and rotation information of the mirror image role secondary root node assembly;
Calculating a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node component;
Setting the reverse kinematics posture of the mirror image skeleton model based on the basic model action and the reverse kinematics data of the original role skeleton model;
carrying out bone space transformation on the mirror image bone model according to the reverse kinematic posture of the mirror image bone model to obtain a mirror image posture of the mirror image bone model;
And carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain a corresponding mirror image of the mirror image bone model and outputting the mirror image.
Optionally, the calculating a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image character secondary root node component includes:
Multiplying the position coordinates of the mirror image role secondary root node component by a preset position transformation operator to obtain the position coordinates of the symmetrical point of the mirror image role secondary root node component, which is symmetrical to the mirror axis;
Calculating a coordinate difference value between the position coordinate of the symmetrical point and the position coordinate of the mirror image role secondary root node component to obtain a displacement vector of the mirror image skeleton model;
multiplying the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetrical to the mirror surface axis;
Wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
Optionally, before the step of setting the inverse kinematic pose of the mirror image bone model based on the base model motion and inverse kinematic data of the original character bone model, the method further includes:
obtaining basic model action and reverse kinematics data of an original role skeleton model, wherein the reverse kinematics data comprises reverse kinematics position data and rotation value data of relevant parts of the original role skeleton model;
the setting of the inverse kinematics pose of the mirror image bone model based on the base model actions and inverse kinematics data of the original character bone model comprises:
based on the basic model action of the original role skeleton model, a reverse kinematics calculation model is adopted to respectively calculate reverse kinematics position data and rotation value data of the relevant parts of the original role skeleton model to obtain the reverse kinematics gesture of the relevant parts of the original role skeleton model;
and setting the reverse kinematic posture of the relevant part of the original character skeleton model as the reverse kinematic posture of the mirror image skeleton model.
Optionally, the position of the primary root node component of the mirror image role is any position coordinate of the mirror surface, and the rotation direction of the primary root node component of the mirror image role is perpendicular to the mirror surface and points to one side of the element role.
Further, to achieve the above object, the present invention also provides a mirroring implementation apparatus based on a UE4 engine, where the mirroring implementation apparatus based on a UE4 engine includes:
A creation module configured to create a mirror role and set a position and rotation information of a master root node component, where the mirror role includes: a primary root node component, a secondary root node component and a mirror image skeleton model;
The first setting module is used for transforming the position and the rotation information of the original role by taking the mirror image role primary root node assembly as a reference standard, and setting the transformed position and the rotation information as the position and the rotation information of the mirror image role secondary root node assembly;
the calculation module is used for calculating a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node component;
The second setting module is used for setting the reverse kinematic posture of the mirror image bone model based on the basic model action and the reverse kinematic data of the original role bone model;
The first transformation module is used for carrying out bone space transformation on the mirror image bone model according to the reverse kinematic posture of the mirror image bone model to obtain a mirror image posture of the mirror image bone model;
and the second transformation module is used for carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain a corresponding mirror image of the mirror image bone model and outputting the mirror image.
optionally, the calculation module comprises:
the first transformation unit is used for multiplying the position coordinate of the mirror image role secondary root node component by a preset position transformation operator to obtain a position coordinate of a symmetrical point of the mirror image role secondary root node component, which is symmetrical to the mirror axis;
the computing unit is used for computing a coordinate difference value between the position coordinate of the symmetrical point and the position coordinate of the mirror image role secondary root node component to obtain a displacement vector of the mirror image skeleton model;
the second transformation unit is used for multiplying the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetrical to the mirror surface axis;
wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
Optionally, the apparatus for implementing mirroring based on the UE4 engine further includes:
the system comprises an acquisition module, a judgment module and a display module, wherein the acquisition module is used for acquiring basic model actions and reverse kinematics data of an original role skeleton model, and the reverse kinematics data comprises reverse kinematics position data and rotation value data of a relevant part of the original role skeleton model;
the second setting module includes:
the calculation unit is used for calculating reverse kinematics position data and rotation value data of the relevant parts of the original role skeleton model respectively by adopting a reverse kinematics calculation model based on the basic model action of the original role skeleton model to obtain the reverse kinematics attitude of the relevant parts of the original role skeleton model;
And the setting unit is used for setting the reverse kinematic posture of the related part of the original character skeleton model as the reverse kinematic posture of the mirror image skeleton model.
Optionally, the position of the primary root node component of the mirror image role is any position coordinate of the mirror surface, and the rotation direction of the primary root node component of the mirror image role is perpendicular to the mirror surface and points to one side of the element role.
In order to achieve the above object, the present invention further provides a UE4 engine-based mirroring implementation apparatus, where the UE4 engine-based mirroring implementation apparatus includes: a memory, a processor, and a UE4 engine based mirroring implementation program stored on the memory and executable on the processor, the UE4 engine based mirroring implementation program when executed by the processor implementing the steps of the UE4 engine based mirroring implementation method as claimed in any one of the above.
to achieve the above object, the present invention further provides a computer readable storage medium, which stores a UE4 engine-based mirroring implementation program, and when the UE4 engine-based mirroring implementation program is executed by a processor, the steps of the UE4 engine-based mirroring implementation method as described in any one of the above embodiments are implemented.
The mirror image role of the invention adopts a three-layer architecture mode of a main root node, a secondary root node and a mirror image skeleton model, firstly, the secondary root node is set to the position of the original role, then, the mirror image role can directly make the posture after the inverse kinematics is resolved by carrying out mirror image transformation on the inverse kinematics target data, and finally, the root skeleton of the skeleton model is set to the correct position of the mirror image and the mirror image action is output, thereby realizing the mirror image effect. Because the invention directly creates a role and puts the role at the other end of the mirror as the mirror image, namely the invention creates the role model which actually exists in the 3D application, and does not depend on the mirror image obtained by a rendering processing mode, the mirror effect is more flexible and changeable, and meanwhile, the system performance can not be lost too much.
Drawings
fig. 1 is a schematic structural diagram of an operating environment of a mirroring implementation device based on a UE4 engine according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a method for implementing mirroring based on a UE4 engine;
FIG. 3 is a schematic diagram illustrating a detailed flow of step S30 in FIG. 2;
FIG. 4 is a flowchart illustrating an embodiment of step S40 in FIG. 2;
FIG. 5 is a functional block diagram of a first embodiment of an apparatus for implementing mirroring based on the UE4 engine according to the present invention;
FIG. 6 is a block diagram illustrating a refinement function of one embodiment of computing module 30 of FIG. 5;
fig. 7 is a functional block diagram of a second embodiment of the mirroring implementation apparatus based on the UE4 engine according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
it should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
the invention provides a mirror image implementation device based on a UE4 engine.
referring to fig. 1, fig. 1 is a schematic structural diagram of an operating environment of a mirroring implementation device based on a UE4 engine according to an embodiment of the present invention.
as shown in fig. 1, the apparatus for implementing mirror based on UE4 engine includes: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the hardware architecture of the UE4 engine-based mirroring implementation shown in fig. 1 does not constitute a limitation of the UE4 engine-based mirroring implementation, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
as shown in fig. 1, the memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and an image implementation program based on an engine of the UE 4. Among other things, the operating system is a program that manages and controls the mirroring implementation devices and software resources based on the UE4 engine, and supports the operation of the mirroring implementation programs based on the UE4 engine, as well as other software and/or programs.
in the hardware architecture of the UE4 engine-based mirroring implementation device shown in fig. 1, the network interface 1004 is mainly used for accessing the network; the user interface 1003 is mainly used for detecting a confirmation instruction, an editing instruction, and the like, and the processor 1001 may be configured to call the UE4 engine-based mirroring implementation program stored in the memory 1005, and perform the following operations of the embodiments of the UE4 engine-based mirroring implementation method.
referring to fig. 2, fig. 2 is a flowchart illustrating an embodiment of a method for implementing mirroring based on a UE4 engine. In this embodiment, the mirror image implementation method based on the UE4 engine includes the following steps:
Step S10, creating a mirror role and setting the position and rotation information of the master root node component, where the mirror role includes: a primary root node component, a secondary root node component and a mirror image skeleton model;
In this embodiment, in the event blueprint flow, a mirror role is created by the UE4 engine, where the mirror role is specifically a mirror image of a role in a virtual scene. The mirroring roles of this embodiment have three layers: the first layer is a main root node component, the second layer is a secondary root node component, the last layer is a mirror image bone model, the position rotation of the lower layer depends on the upper layer, and the position rotation of the upper layer is changed to drive the lower layer to change correspondingly.
in this embodiment, after the mirroring role is created, the position and rotation information of the first-layer master root node component is further set.
Optionally, in an embodiment, the position of the primary root node component of the mirror image role is an arbitrary position coordinate of the mirror surface, and the rotation direction of the primary root node component of the mirror image role is perpendicular to the mirror surface and points to one side of the meta-role. Since the mirror itself can be any position and direction of world coordinates, and the mirror image is a mirror image of the original role relative to the mirror, the position of the mirror surface is calibrated through the master root node component of the mirror image role in the optional embodiment, and the rotation direction of the mirror image role is further calibrated.
step S20, using the mirror image role primary root node assembly as a reference standard, transforming the position and rotation information of the original role, and setting the transformed position and rotation information as the position and rotation information of the mirror image role secondary root node assembly;
In this embodiment, after the position and the rotation direction of the primary root node component of the mirror image character are set, the position and the rotation information of the secondary root node component of the mirror image character are further set, specifically, the position and the rotation information of the original character (a virtual character in a virtual world, such as a game character in a game) are transformed with the primary root node component of the mirror image character as a reference, and the transformed position and rotation information are set as the position and the rotation information of the secondary root node component of the mirror image character.
in this embodiment, the relative coordinates and rotation information obtained by the position and rotation information of the original character relative to the mirror image character primary root node component are specifically used as the position and rotation information of the mirror image character secondary root node component, that is, the position and rotation information of the original character are calibrated by the mirror image character secondary root node component, and further, before the mirror image action is output, the mirror image bone model is set at the position of the original character bone model.
step S30, calculating displacement vectors and rotation values of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node assembly;
In this embodiment, after the mirror role primary root node component and the secondary root node component are set, in order to implement the mirror action of the mirror role, a displacement vector and a rotation value of the mirror skeleton model need to be further calculated, that is, a displacement vector moving from a position where the secondary root node component is located (also an original role position) to a mirror position and a rotation value required for the mirror skeleton to rotate from a direction where the secondary root node is located (also an original role direction) to a mirror rotation direction when the UE4 engine executes the animation blueprint process are calculated.
Step S40, setting the inverse kinematics posture of the mirror image skeleton model based on the basic model action and the inverse kinematics data of the original role skeleton model;
Inverse Kinematics (IK) refers to the implementation of a movement starting from a free end and reversing to a fixed end, i.e. specifically the implementation of a position and transformation of a parent bone, followed by the Inverse of a position and transformation of a child bone. For example, given the coordinates of a certain position that the hand of a skeleton model needs to reach, the postures of multiple skeletons such as an arm when the hand of the skeleton model reaches the position coordinates can be calculated through inverse kinematics.
In this embodiment, the mirror image posture of the bone model is specifically solved through IK, and the position and rotation of the mirror image bone model are consistent with the original role, that is, the same IK target data as the original role needs to be used, so as to solve the IK posture of the mirror image bone model.
Step S50, according to the inverse kinematics gesture of the mirror image bone model, carrying out bone space transformation on the mirror image bone model to obtain the mirror image gesture of the mirror image bone model;
In this embodiment, the IK posture of the mirror image Bone model calculated by IK solution is consistent with the posture of the original character Bone model, and therefore, in order to realize the mirror image effect of the IK posture of the mirror image Bone model, Bone space transformation (i.e., TransForm Bone processing) needs to be further performed on the mirror image Bone model by the UE4 engine, so as to realize the mirror image effect.
in this embodiment, the bone space transformation is preferably realized by multiplying the position coordinates of the mirror image bone model by the Vector (1, 1, -1), wherein the Vector coordinate axis of the-1 is the axis of the mirror image bone model in the middle of the left and right directions, and at this time, the posture of the whole mirror image bone model is changed to the mirror image posture opposite to the left and right of the original character bone model.
and step S60, carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain a mirror image corresponding to the mirror image bone model and outputting the mirror image.
in this embodiment, although the mirror image bone model already exhibits the mirror image effect in the posture, the position and the rotation direction of the mirror image bone model are still set at the position and the rotation direction of the original character, that is, the requirement of the mirror image effect is still not satisfied currently, and therefore, the position and the rotation direction of the mirror image bone model need to be further set, so that the mirror image bone model is changed to the other surface of the mirror.
in this embodiment, on the basis of maintaining the mirror image posture of the mirror image bone model, the mirror image bone model is subjected to a bone space transformation regarding displacement and rotation once again according to the displacement vector and the rotation value of the mirror image bone model, so that the entire mirror image bone model appears on the other side of the mirror and the action of the mirror image bone model is a mirror image action.
the mirror image role of the embodiment adopts a three-layer architecture mode of a main root node, a secondary root node and a mirror image skeleton model, firstly, the secondary root node is set to the position of an original role, then, mirror image transformation is carried out on reverse kinematics target data, the mirror image role can be directly made to make a posture after reverse kinematics resolving, and finally, the root skeleton of the skeleton model is set to the correct position of a mirror image and mirror image action is output, so that the mirror surface effect is realized. Because the invention directly creates a role and puts the role at the other end of the mirror as the mirror image, namely the role model actually existing in the 3D application is created in the embodiment, and the mirror image is not obtained by a rendering processing mode, the mirror effect is more flexible and changeable, and the system performance is not lost too much.
Referring to fig. 3, fig. 3 is a schematic view of a detailed flow of the step S30 in fig. 2. Based on the foregoing embodiment, in this embodiment, the foregoing step S30 further includes:
step S301, multiplying the position coordinate of the mirror image role secondary root node component by a preset position transformation operator to obtain a position coordinate of a symmetrical point of the mirror image role secondary root node component, which is symmetrical to a mirror axis;
Step S302, calculating a coordinate difference value between the position coordinates of the symmetrical point and the position coordinates of the mirror image role secondary root node assembly to obtain a displacement vector of the mirror image skeleton model;
step S303, multiplying the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetrical to the mirror surface axis;
Wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
in this embodiment, the displacement vector and the rotation value of the mirror image bone model are specifically calculated in the following manner:
(1) multiplying the relative position of the mirror image role secondary root node component relative to the primary root node component by a Vector (-1, 1, 1) to obtain a point of the mirror image role secondary root node component which is axially symmetrical relative to the mirror surface;
(2) subtracting the position coordinate of the secondary root node component from the position coordinate of the point obtained in the upper part to obtain a displacement vector of the mirror image bone model;
(3) The rotation value required for the mirror image bone model to rotate from the secondary root node component to the mirror image role rotation direction is as follows: the sub-root node element is multiplied by-2 on the Yaw axis, wherein the rotation direction of the bone model can be rotated to a direction with a relative zero direction by multiplying one rotation by-1, and then the rotation direction can be rotated to a rotation direction symmetrical to the mirror axis by multiplying another rotation by-1. Wherein, the rotation transformation operator is expressed by quaternion, and-2 is an imaginary part numerical value.
Referring to fig. 4, fig. 4 is a flowchart illustrating an embodiment of step S40 in fig. 2. Based on the foregoing embodiment, in the present embodiment, the foregoing step S40 further includes:
step S401, based on the basic model action of the original character skeleton model, adopting a reverse kinematics calculation model to respectively calculate reverse kinematics position data and rotation value data of the relevant part of the original character skeleton model to obtain a reverse kinematics attitude of the relevant part of the original character skeleton model;
and S402, setting the reverse kinematic posture of the relevant part of the original character skeleton model as the reverse kinematic posture of the mirror image skeleton model.
in this embodiment, before the inverse kinematics attitude (i.e., the IK attitude) of the mirror image skeleton model is calculated by the IK solution, the basic model action and the inverse kinematics data of the original character skeleton model are obtained. In this embodiment, the inverse kinematics data of the original character skeleton model includes: and inverse kinematics position data and rotation value data of the relevant parts of the original character skeleton model.
(1) firstly, based on the basic model action of the original role skeleton model, adopting a reverse kinematics calculation model to respectively calculate the IK position data and the IK rotation value data of the related part of the original role skeleton model to obtain the IK posture of the related part of the original role skeleton model; the relevant parts of the original character skeleton model can be hands, feet and heads, and can also be movable joint parts.
(2) After the IK posture of the relevant part of the original character skeleton model is determined, the reverse kinematic posture of the relevant part of the original character skeleton model is set as the reverse kinematic posture of the mirror image skeleton model.
In the embodiment, the IK posture of the mirror image skeleton model is determined in an IK resolving mode, so that the mirror image role can directly make the posture after the IK resolving without mirror image transformation.
the invention also provides a mirror image implementation device based on the UE4 engine.
Referring to fig. 5, fig. 5 is a functional module diagram of a first embodiment of the mirroring implementation apparatus based on the UE4 engine according to the present invention. In this embodiment, the mirror image implementation apparatus based on the UE4 engine includes:
A creating module 10, configured to create a mirror role and set the position and rotation information of the master root node component, where the mirror role includes: a primary root node component, a secondary root node component and a mirror image skeleton model;
A first setting module 20, configured to transform the position and rotation information of the original role with the mirror role primary root node component as a reference, and set the transformed position and rotation information as the position and rotation information of the mirror role secondary root node component;
a calculation module 30, configured to calculate a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node component;
A second setting module 40, configured to set an inverse kinematics posture of the mirror image skeleton model based on a base model action and inverse kinematics data of the original character skeleton model;
a first transformation module 50, configured to perform bone space transformation on the mirror image bone model according to the inverse kinematics posture of the mirror image bone model, so as to obtain a mirror image posture of the mirror image bone model;
and the second transformation module 60 is configured to perform bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model, obtain a mirror image corresponding to the mirror image bone model, and output the mirror image.
based on the same embodiment description as the mirror implementation method based on the UE4 engine in the present invention, the contents of the embodiment of the mirror implementation apparatus based on the UE4 engine are not described in detail in this embodiment.
the mirror image role of the embodiment adopts a three-layer architecture mode of a main root node, a secondary root node and a mirror image skeleton model, firstly, the secondary root node is set to the position of an original role, then, mirror image transformation is carried out on reverse kinematics target data, the mirror image role can be directly made to make a posture after reverse kinematics resolving, and finally, the root skeleton of the skeleton model is set to the correct position of a mirror image and mirror image action is output, so that the mirror surface effect is realized. Because the invention directly creates a role and puts the role at the other end of the mirror as the mirror image, namely the role model actually existing in the 3D application is created in the embodiment, and the mirror image is not obtained by a rendering processing mode, the mirror effect is more flexible and changeable, and the system performance is not lost too much.
referring to fig. 6, fig. 6 is a schematic diagram of a detailed functional module of an embodiment of the computing module 30 in fig. 5. Based on the foregoing embodiment, in this embodiment, the calculating module 30 includes:
A first transformation unit 301, configured to multiply the position coordinate of the mirror image role secondary root node component by a preset position transformation operator to obtain a position coordinate of a symmetric point, where the mirror image role secondary root node component is symmetric to the mirror axis;
A calculating unit 302, configured to calculate a coordinate difference between the position coordinate of the symmetric point and the position coordinate of the mirror image role secondary root node component, so as to obtain a displacement vector of the mirror image skeleton model;
a second transformation unit 303, configured to multiply the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetric to the mirror axis;
wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
based on the same embodiment description as the mirror implementation method based on the UE4 engine in the present invention, the contents of the embodiment of the mirror implementation apparatus based on the UE4 engine are not described in detail in this embodiment.
referring to fig. 7, fig. 7 is a functional module diagram of a second embodiment of the mirroring implementation apparatus based on the UE4 engine according to the present invention. In this embodiment, the apparatus for implementing mirroring based on the UE4 engine further includes:
An obtaining module 70, configured to obtain basic model actions and inverse kinematics data of an original character skeleton model, where the inverse kinematics data includes inverse kinematics position data and rotation value data of a relevant portion of the original character skeleton model;
in this embodiment, the second setting module 40 further includes:
The calculating unit 401 is configured to calculate, based on a basic model action of the original character skeleton model, reverse kinematics position data and rotation value data of a relevant part of the original character skeleton model by using a reverse kinematics calculating model, respectively, to obtain a reverse kinematics posture of the relevant part of the original character skeleton model;
a setting unit 402, configured to set the inverse kinematic pose of the relevant portion of the original character bone model as the inverse kinematic pose of the mirror image bone model.
Based on the same embodiment description as the mirror implementation method based on the UE4 engine in the present invention, the contents of the embodiment of the mirror implementation apparatus based on the UE4 engine are not described in detail in this embodiment.
The invention also provides a computer readable storage medium.
in this embodiment, the computer readable storage medium stores a UE4 engine-based mirroring implementation program, and when executed by the processor, the UE4 engine-based mirroring implementation program implements the steps of the UE4 engine-based mirroring implementation method as described in any one of the above embodiments.
through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM), and includes instructions for causing a terminal (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
the present invention is described in connection with the accompanying drawings, but the present invention is not limited to the above embodiments, which are only illustrative and not restrictive, and those skilled in the art can make various changes without departing from the spirit and scope of the invention as defined by the appended claims, and all changes that come within the meaning and range of equivalency of the specification and drawings that are obvious from the description and the attached claims are intended to be embraced therein.

Claims (10)

1. a mirror implementation method based on a UE4 engine is characterized in that the mirror implementation method based on the UE4 engine comprises the following steps:
Creating a mirror role and setting the position and rotation information of a main root node component, wherein the mirror role comprises the following steps: a primary root node component, a secondary root node component and a mirror image skeleton model;
The mirror image role primary root node assembly is used as a reference standard, the position and rotation information of the original role are converted, and the converted position and rotation information are set as the position and rotation information of the mirror image role secondary root node assembly;
calculating a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node component;
setting the reverse kinematics posture of the mirror image skeleton model based on the basic model action and the reverse kinematics data of the original role skeleton model;
Carrying out bone space transformation on the mirror image bone model according to the reverse kinematic posture of the mirror image bone model to obtain a mirror image posture of the mirror image bone model;
and carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain a corresponding mirror image of the mirror image bone model and outputting the mirror image.
2. The UE4 engine-based mirroring implementation method of claim 1, wherein the calculating displacement vectors and rotation values for the mirrored bone model based on the location and rotation information of the mirrored character secondary root node component comprises:
multiplying the position coordinates of the mirror image role secondary root node component by a preset position transformation operator to obtain the position coordinates of the symmetrical point of the mirror image role secondary root node component, which is symmetrical to the mirror axis;
Calculating a coordinate difference value between the position coordinate of the symmetrical point and the position coordinate of the mirror image role secondary root node component to obtain a displacement vector of the mirror image skeleton model;
Multiplying the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetrical to the mirror surface axis;
wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
3. The method for implementing UE4 engine-based mirroring according to claim 1 or 2, wherein before the step of setting the inverse kinematics pose of the mirrored bone model based on the base model actions and inverse kinematics data of the original character bone model, further comprising:
obtaining basic model action and reverse kinematics data of an original role skeleton model, wherein the reverse kinematics data comprises reverse kinematics position data and rotation value data of relevant parts of the original role skeleton model;
the setting of the inverse kinematics pose of the mirror image bone model based on the base model actions and inverse kinematics data of the original character bone model comprises:
Based on the basic model action of the original role skeleton model, a reverse kinematics calculation model is adopted to respectively calculate reverse kinematics position data and rotation value data of the relevant parts of the original role skeleton model to obtain the reverse kinematics gesture of the relevant parts of the original role skeleton model;
And setting the reverse kinematic posture of the relevant part of the original character skeleton model as the reverse kinematic posture of the mirror image skeleton model.
4. The UE4 engine-based mirroring implementation method of claim 1, wherein the position of the primary root node component of the mirroring role is an arbitrary position coordinate of a mirror plane, and a rotation direction of the primary root node component of the mirroring role is perpendicular to the mirror plane and points to a side of a meta-role.
5. An apparatus for implementing mirror based on UE4 engine, wherein the apparatus for implementing mirror based on UE4 engine comprises:
a creation module configured to create a mirror role and set a position and rotation information of a master root node component, where the mirror role includes: a primary root node component, a secondary root node component and a mirror image skeleton model;
The first setting module is used for transforming the position and the rotation information of the original role by taking the mirror image role primary root node assembly as a reference standard, and setting the transformed position and the rotation information as the position and the rotation information of the mirror image role secondary root node assembly;
the calculation module is used for calculating a displacement vector and a rotation value of the mirror image bone model based on the position and rotation information of the mirror image role secondary root node component;
The second setting module is used for setting the reverse kinematic posture of the mirror image bone model based on the basic model action and the reverse kinematic data of the original role bone model;
the first transformation module is used for carrying out bone space transformation on the mirror image bone model according to the reverse kinematic posture of the mirror image bone model to obtain a mirror image posture of the mirror image bone model;
and the second transformation module is used for carrying out bone space transformation on the mirror image bone model according to the displacement vector and the rotation value of the mirror image bone model and the mirror image posture of the mirror image bone model to obtain a corresponding mirror image of the mirror image bone model and outputting the mirror image.
6. The UE4 engine-based mirroring implementation apparatus of claim 5, wherein the calculation module comprises:
the first transformation unit is used for multiplying the position coordinate of the mirror image role secondary root node component by a preset position transformation operator to obtain a position coordinate of a symmetrical point of the mirror image role secondary root node component, which is symmetrical to the mirror axis;
The computing unit is used for computing a coordinate difference value between the position coordinate of the symmetrical point and the position coordinate of the mirror image role secondary root node component to obtain a displacement vector of the mirror image skeleton model;
The second transformation unit is used for multiplying the rotation value of the mirror image role secondary root node component by a preset rotation transformation operator to obtain a rotation value of the mirror image skeleton model rotating to a rotation direction symmetrical to the mirror surface axis;
wherein the position transform operator is: multiplying the X-axis coordinate by-1, and multiplying the Y-axis coordinate and the Z-axis coordinate by 1 respectively; the rotation transformation operator is: the Y-axis rotation value is multiplied by-2, and the X-axis rotation value and the Z-axis rotation value are kept unchanged.
7. the UE4 engine-based mirroring implementation apparatus of claim 5 or 6, wherein the UE4 engine-based mirroring implementation apparatus further comprises:
the system comprises an acquisition module, a judgment module and a display module, wherein the acquisition module is used for acquiring basic model actions and reverse kinematics data of an original role skeleton model, and the reverse kinematics data comprises reverse kinematics position data and rotation value data of a relevant part of the original role skeleton model;
The second setting module includes:
the calculation unit is used for calculating reverse kinematics position data and rotation value data of the relevant parts of the original role skeleton model respectively by adopting a reverse kinematics calculation model based on the basic model action of the original role skeleton model to obtain the reverse kinematics attitude of the relevant parts of the original role skeleton model;
and the setting unit is used for setting the reverse kinematic posture of the related part of the original character skeleton model as the reverse kinematic posture of the mirror image skeleton model.
8. the UE4 engine-based mirroring implementation apparatus of claim 5, wherein the position of the primary root node component of the mirroring role is an arbitrary position coordinate of a mirror plane, and a rotation direction of the primary root node component of the mirroring role is perpendicular to the mirror plane and points to a side of a meta-role.
9. a UE4 engine-based mirroring implementation device, wherein the UE4 engine-based mirroring implementation device comprises: a memory, a processor, and a UE4 engine based mirroring implementation program stored on the memory and executable on the processor, the UE4 engine based mirroring implementation program when executed by the processor implementing the steps of the UE4 engine based mirroring implementation method of any one of claims 1-4.
10. A computer-readable storage medium, wherein a UE4 engine-based mirroring implementation program is stored on the computer-readable storage medium, and when executed by a processor, the UE4 engine-based mirroring implementation program implements the steps of the UE4 engine-based mirroring implementation method according to any one of claims 1 to 4.
CN201910612942.8A 2019-07-09 2019-07-09 mirror image implementation method, device, equipment and storage medium based on UE4 engine Pending CN110570357A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910612942.8A CN110570357A (en) 2019-07-09 2019-07-09 mirror image implementation method, device, equipment and storage medium based on UE4 engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910612942.8A CN110570357A (en) 2019-07-09 2019-07-09 mirror image implementation method, device, equipment and storage medium based on UE4 engine

Publications (1)

Publication Number Publication Date
CN110570357A true CN110570357A (en) 2019-12-13

Family

ID=68772893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910612942.8A Pending CN110570357A (en) 2019-07-09 2019-07-09 mirror image implementation method, device, equipment and storage medium based on UE4 engine

Country Status (1)

Country Link
CN (1) CN110570357A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667558A (en) * 2020-06-11 2020-09-15 深圳市瑞立视多媒体科技有限公司 Rope connection optimization method based on unreal engine and related equipment
CN112348931A (en) * 2020-11-06 2021-02-09 网易(杭州)网络有限公司 Foot reverse motion control method, device, equipment and storage medium
CN112973118A (en) * 2021-04-15 2021-06-18 腾讯科技(深圳)有限公司 Skeleton animation display method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103597516A (en) * 2011-06-06 2014-02-19 微软公司 Controlling objects in a virtual environment
CN107005689A (en) * 2014-12-03 2017-08-01 诺基亚技术有限公司 Digital video is rendered
US20180268601A1 (en) * 2017-03-16 2018-09-20 Qualcomm Incorporated Three-dimensional pose estimation of symmetrical objects
US20190035129A1 (en) * 2017-07-28 2019-01-31 Baobab Studios Inc. Systems and methods for real-time complex character animations and interactivity

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103597516A (en) * 2011-06-06 2014-02-19 微软公司 Controlling objects in a virtual environment
CN107005689A (en) * 2014-12-03 2017-08-01 诺基亚技术有限公司 Digital video is rendered
US20180268601A1 (en) * 2017-03-16 2018-09-20 Qualcomm Incorporated Three-dimensional pose estimation of symmetrical objects
US20190035129A1 (en) * 2017-07-28 2019-01-31 Baobab Studios Inc. Systems and methods for real-time complex character animations and interactivity

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111667558A (en) * 2020-06-11 2020-09-15 深圳市瑞立视多媒体科技有限公司 Rope connection optimization method based on unreal engine and related equipment
CN111667558B (en) * 2020-06-11 2023-11-28 深圳市瑞立视多媒体科技有限公司 Rope connection optimization method based on illusion engine and related equipment
CN112348931A (en) * 2020-11-06 2021-02-09 网易(杭州)网络有限公司 Foot reverse motion control method, device, equipment and storage medium
CN112348931B (en) * 2020-11-06 2024-01-30 网易(杭州)网络有限公司 Foot reverse motion control method, device, equipment and storage medium
CN112973118A (en) * 2021-04-15 2021-06-18 腾讯科技(深圳)有限公司 Skeleton animation display method, device, equipment and storage medium
CN112973118B (en) * 2021-04-15 2022-07-29 腾讯科技(深圳)有限公司 Skeleton animation display method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
KR102055995B1 (en) Apparatus and method to generate realistic rigged three dimensional (3d) model animation for view-point transform
US6091410A (en) Avatar pointing mode
CN111803945B (en) Interface rendering method and device, electronic equipment and storage medium
CN110568923A (en) unity 3D-based virtual reality interaction method, device, equipment and storage medium
CN111161422A (en) Model display method for enhancing virtual scene implementation
CN110570357A (en) mirror image implementation method, device, equipment and storage medium based on UE4 engine
CN109144252B (en) Object determination method, device, equipment and storage medium
Valentini et al. Interactive sculpting using augmented-reality, mesh morphing, and force feedback: Force-feedback capabilities in an augmented reality environment
Nishino et al. 3d object modeling using spatial and pictographic gestures
CN114494328B (en) Image display method, device, electronic equipment and storage medium
JP6360509B2 (en) Information processing program, information processing system, information processing method, and information processing apparatus
JP6596919B2 (en) Calculation execution method, calculation processing system, and program
Schönauer et al. Wide area motion tracking using consumer hardware
WO2023240999A1 (en) Virtual reality scene determination method and apparatus, and system
CN109636888B (en) 2D special effect manufacturing method and device, electronic equipment and storage medium
CN112862981B (en) Method and apparatus for presenting a virtual representation, computer device and storage medium
TW201935188A (en) Tracking system, tracking method for real-time rendering an image and non-transitory computer-readable medium
US8289331B1 (en) Asymmetric animation links
CN114419226A (en) Panorama rendering method and device, computer equipment and storage medium
CN115222854A (en) Virtual image collision processing method and device, electronic equipment and storage medium
Lv et al. Interaction design in augmented reality on the smartphone
US8890889B1 (en) System and method for generating a pose of an object
CN111524240A (en) Scene switching method and device and augmented reality equipment
Jung et al. Web-based 3D virtual experience using unity and leap motion
CN111612883B (en) Processing method, device and storage medium for cube map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191213