TianxingWu / OpenVHead

A 3D virtual head control system for VTuber in Unity with smooth motion and robust facial expressions
MIT License
440 stars 55 forks source link

why are there different rotation update methods for two models? #13

Open animebing opened 3 years ago

animebing commented 3 years ago

Thanks for your nice work and great documentation and I have run it successfully. When I read the code in ParameterServer.cs, I find that the rotation update methods for model 1 and model 2 are different, which puzzles me a lot. Would you mind telling why and sharing some references to read?

TianxingWu commented 3 years ago

Thanks for your nice work and great documentation and I have run it successfully. When I read the code in ParameterServer.cs, I find that the rotation update methods for model 1 and model 2 are different, which puzzles me a lot. Would you mind telling why and sharing some references to read?

Thanks for your feedback. The rotation update methods of the two models are different because the local frame settings are not well aligned. To be more specific, since the two models are created separately, the orientations of the two "faces" respect to its own object frame happens to be different. As a result, if you want the two faces appeares to be at the same orientation respect to the world frame, the rotation transformations (from its object frame to the world frame) would be different. You can read more materials about rotation transformation, world frame, object frame etc. to be more clear about the problem. In my case the rotation transformation is described in a quaternion (x,y,z,w) for simplicity, however you can just focus on the rotation matrix stuff as it is more clear and easy to understand.