Created
November 15, 2018 03:30
-
-
Save baobao/589629688448792f1da5c2c55c3e3248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ビュー変換行列 | |
var vMatrix = Matrix.LookAtRH( | |
new Vector3(0, 0, 1.3f), | |
new Vector3(0, 0, 0), | |
new Vector3(0, 1f, 0) | |
); | |
// プロジェクション変換行列 | |
var pMatrix = Matrix.PerspectiveFovRH( | |
(float)System.Math.PI / 2, | |
(float)ClientSize.Width / (float)ClientSize.Height, | |
// マイナス値ダメ!! | |
0f, | |
100f | |
); | |
// シェーダへVPMatrixを渡す | |
var vpMatrix = vMatrix * pMatrix; | |
effect.GetVariableByName("VPMatrix").AsMatrix().SetMatrix(vpMatrix); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment