すいません、追記です。 自前でスクリーン座標変換を行いたい場合は以下のとおりになります。
// ビュー行列と射影行列の取得
MATRIX view = camera->GetViewMatrix();
MATRIX proj = camera->GetPerspectiveMatrix();
// ビューポート行列(スクリーン行列)の作成
float w = (float)screenSize.x / 2.0f;
float h = (float)screenSize.y / 2.0f;
MATRIX viewport = {
w , 0 , 0 , 0 ,
0 ,-h , 0 , 0 ,
0 , 0 , 1 , 0 ,
w , h , 0 , 1
};
VECTOR screenPos , tmp = model->pos;
// ビュー変換とプロジェクション変換
tmp = VTransform(tmp , view);
tmp = VTransform(tmp , proj);
// zで割って-1~1の範囲に収める
tmp.x /= tmp.z; tmp.y /= tmp.z; tmp.z /= tmp.z;
// スクリーン変換
screenPos = VTransform(vec , viewport);