-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[]

, 04 2017 . 10:11 +
image

. , , , , , .

GIF

:

  • 1.
  • 2.
  • 3.
  • 4.
  • 5. -
  • 6.
  • 7.

1.


. , . . . , . . , , , . , . .

, . . (Wikipedia). . , .

, (rigid body simulation). , Unity Unreal. , .

Ragdoll-


. , , . , (, ragdoll)(Wikipedia). (joints) , . , . . , . , .

, .

GIF


. Unity Ragdoll Wizard, .


. , , . . , .

How Grow Home Uses Maths To Generate Personality (Alex Wiltshire) Ubisoft Grow Home. , (BUD). , , . , . , , .




Rain World. , . , . . , . , .

GIF


Grow Home, Rain World . . Gang Beasts . , ragdoll-. .

GIF


. , , . , . , , . -, , .

. , , . Grow Home Rain World , . .

-, , The Majesty Of Color Future Proof Games. . Rain World, . , . , , .

GIF

. . , , . , . , , , .

Unity Mechanim ( Unity), .



. , - .

GIF

2.


. , .

, , . . , , , .

-


-. . . , .

-, , -:



-, (limbs), (joints). , , . , .

, . , .



, -, . . , .


. . , . , , .

. , , . , - .


, , . , .

3D , . - , .



. , . , . , .



, , , . . .



, , . ( ) , .


, () .

, . , .

, . , , :



, :



, :



:



, AngleAxis ( Unity) .

, :



, , :



, C#.


-?
, . , . , - (Wikipedia). .



. - , . , .

3.


. , , C# Unity. , , .


-. . :



, - . , , .

:



:

  • . :

  • . :


, Unity.

GameObject


Unity : (parenting). , , .



, . , , , . Unity Animation 3: Character Setup .



, , , - . T- , .


Unity - . , . , -. - Unity.

-. , RobotJoint :

using UnityEngine;
 
public class RobotJoint : MonoBehaviour
{
    public Vector3 Axis;
    public Vector3 StartOffset;
 
    void Awake ()
    {
        StartOffset = transform.localPosition;
    }
}

, : X, Y Z. Axis, 1 . Y, Axis (0,1,0). , IF.

ForwardKinematics. angles float. : angles[i] i- . .

public Vector3 ForwardKinematics (float [] angles)
{
    ...
}

C# . rotate Quaternion.AngleAxis.

Vector3 prevPoint = Joints[0].transform.position;
Quaternion rotation = Quaternion.identity;
for (int i = 1; i < Joints.Length; i++)
{
    //     
    rotation *= Quaternion.AngleAxis(angles[i - 1], Joints[i - 1].Axis);
    Vector3 nextPoint = prevPoint + rotation * Joints[i].StartOffset;
    
    prevPoint = nextPoint;
}
return prevPoint;

?
Unity . , X, Y Z. (roll), (pitch) (yaw) . .

(quaternions). , . , . , . , , .

<=>


. , , . Unity Quaternion.AngleAxis. Quaternion.AngleAxis(angle, axis); , axis angle . Axis (1,0,0), (0,1,0) (0,0,1), , , X, Y Z. , Axis RobotJoint.

<=>


, . for rotation . , .

* =


, :

Vector3 nextPoint = prevPoint + rotation * Joints[i].StartOffset;

:



.

[ . .]
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/332164/

:  

: [1] []
 

:
: 

: ( )

:

  URL