UPC-ViRVIG / MMVR

Repository for the SCA 2022 paper "Combining Motion Matching and Orientation Prediction to Animate Avatars for Consumer-Grade VR Devices"
https://upc-virvig.github.io/MMVR/
Other
58 stars 7 forks source link

MotionMatching Search - DB classification #5

Closed tejaswiniiitm closed 1 year ago

tejaswiniiitm commented 1 year ago

Hi @JLPM22

In the paper, you mentioned that you have used different DBs for MotionMatching search, where each DB is mapped to a height ratio. And that you have done so to avoid adding more complexity to the search and prevent unnecessary pose changes.

In our scenario, person would be moving from normal height to bending in a single animation. And all animations would be of that sort. In such case, it is possible for us to have different DBs based on other categorization, instead of height basis, to reduce search complexity. But in each animation of the DB, person would be moving from one height to the other. So, is that okay?

Search complexity is not issue here, since we will have multiple DBs only, but based on different categorization. But, can we get good output, where person would be moving from one height to the other in each of the animations (bending front/bending back/ squatting with one leg front and one leg back etc) is my doubt!

If not, what can be done for relatively better results? Like any other motion matching algorithm, or by adding additional things to existing motion matching algorithm etc.

JLPM22 commented 1 year ago

If you have a different DB for each type of movement, I think adding the HMD height as an additional feature should be fine. You can do the first test as follows: You can try adding it as a trajectory feature, in the Motion Matching Data click Add Trajectory Feature, give it a name such as "Height", in type select Position, Frames Prediction equal to 20, 40, 60; Bone select Head or Neck and leave Project unchecked. Finally, press Generate Database. Then you need to fill this trajectory at runtime so that MotionMatching can compare it against the database. Go to VRCharacterController line 214 and modify it to something like this

case TrajectoryFeature.Type.Position:
    if (feature.Name == "Height")
    {
        float3 pos = GetWorldSpacePosition(predictionIndex);
        return new float3(0, pos.y, 0); // Ideally you change the code to allow 1D features instead of this
    }
    else
    {
        float3 pos = GetWorldSpacePosition(predictionIndex);
        pos.y = 0.0f; // Project to the ground
        return pos;
    }

MotionMatchingController automatically reads this world space information and transforms it to character space (MotionMatchingController.cs function FillTrajectory (line 305)) and uses it for the search. Features for the database are extracted in the file FeatureSet.cs in case you want to do modifications.

Note that the provided code in this project only supports 3D/2D features, ideally, you can modify the feature extraction and MotionMatchingController a little bit to define 1D features such as Height.

Hope it helps!