dtxmania / mikumikuflex Goto Github PK
View Code? Open in Web Editor NEWThis project forked from kyasbal/mmf
C#用のMikuMikuDance描画ライブラリ。DirectX11対応。
License: Other
This project forked from kyasbal/mmf
C#用のMikuMikuDance描画ライブラリ。DirectX11対応。
License: Other
I translated the whole project into English. All file names and all methods and members. The compilation is identical to the original project, but everything is in English. Are you interested in workable sources entirely in English?
It’s hard for me to work with sources in Japanese.
///JAPAN
このコードにエラーがあります。
#region " 親付与によるFKを適用する。"
//----------------
this._親付与によるFK変形更新.変形を更新する();
this._モデルポーズを再計算する();
//----------------
#endregion
このコードにはコメントが必要です
#region " 親付与によるFKを適用する。"
//----------------
//this._親付与によるFK変形更新.変形を更新する();
//this._モデルポーズを再計算する();
//----------------
#endregion
そして、いくつかの変更を行う必要があります
拡張:
FKはIKの前とIKの間に呼び出す必要があります。
1)クラス「ボーンコントロール」では、「親ボーンの子を許可」のリストが必要であり、このリストは「子ボーンのリスト」と同じように入力されますが、「親ボーン」の代わりに「親ボーンを許可」を受け取ります(フォワードキネマティクスで使用されます) )
2)クラス "ボーンコントロール"に "親の付与されたボーン"、 "付与された位置"、および "付与された回転"変数を追加する必要があります(クラスコンストラクタではそれらをゼロにしますが、 "親の付与されたボーン"は計算子ボーンループで埋める必要があります)
3)手順「モデルポーズの計算」では、
3.1)「許可された回転」と「許可された位置」を、「親許可された骨」から「この骨」への順**学を介して計算します(「許可された親骨」がnullでない場合のみ)。
3.2)位置+回転(アニメーション、インバースキネマティクス、物理)に加えて、「許可された位置」+「許可された回転」(位置+許可された位置の回転*許可された回転)によって骨の新しいローカル位置を計算します。
3.3)親ボーンからグローバルポジションを計算します。
3.4)すべての子ボーンをループして計算します。
3.5)すべての影響を受けるボーンをループして計算します(リスト「親のボーンの子を許可する」を使用)。
4)ドロープロシージャのフォワードキネマティクスを削除する必要があります。
5)ボーンの新しい位置と新しい回転を取得した後の物理演算では、位置から「許可された位置」(ボーン位置=ボーン位置-ボーン「許可された位置」)と回転から「許可された回転」(ボーン回転=ボーン回転)を削除する必要があります。 *反転したボーンの「許可された回転」)。
それで全部です。
///ENGLISH
In this code error:
#region " 親付与によるFKを適用する。"
//----------------
this._親付与によるFK変形更新.変形を更新する();
this._モデルポーズを再計算する();
//----------------
#endregion
This code must be commented
#region " 親付与によるFKを適用する。"
//----------------
//this._親付与によるFK変形更新.変形を更新する();
//this._モデルポーズを再計算する();
//----------------
#endregion
And some changes need to be done
Explanation:
FK must call before IK and during IK.
Thats all.
I think this code helps your to improve this project.
All variables and file names are translated to English for simplicity, and you can translate it back to japan.
This code is for last region of procedude Draw (public void 描画する) of the file PMX_model.cs (PMXモデル.cs)):
#region " Set D3D pipeline (material unit)."
//----------------
//++ change block 1
//old code
//d3ddc.Rasterizer.State = this._rasterizerStateForBacksideSingleSidedDrawing;
//new code
//check if edge needed
if (material.drawingFlag.HasFlag(PMXFormat.Drawing_flag.edge)){
d3ddc.Rasterizer.State = this._rasterizerStateForBacksideSingleSidedDrawing;
}
//-- change block 1
//----------------
#endregion
//++ change block 2
//old code
/*materialDrawingShader.Draw(
d3ddc,
material.numberOfVertices,
material.startingIndex,
MMDPass.Edge,
globalParameters,
this._globalParametersConstantBuffer,
textureSRV,
sphereMapTextureSRV,
toonTextureSRV);*/
//new code
//check if edge needed
if (material.drawingFlag.HasFlag(PMXFormat.Drawing_flag.edge)){
materialDrawingShader.Draw(
d3ddc,
material.numberOfVertices,
material.startingIndex,
MMDPass.Edge,
globalParameters,
this._globalParametersConstantBuffer,
textureSRV,
sphereMapTextureSRV,
toonTextureSRV);
}
//-- change block 2
Short explain: if edge flag is not setted, we MUST zero edgeColor and edgeSize, and we MUST not to call edge draw pass. Because some textures will flick (hair and clothes) with not needed edge pass.
That's all. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.